AppView comes with built-in support for three privacy-friendly web analytics options:
These tools focus on privacy and don’t rely on tracking cookies, so you don’t need to add a cookie consent banner.
Enable Plausible analytics
Once you set up your Plausible project , open
app/(main)/layout.tsx and find the <PlausibleAnalytics> component, which is
commented by default.
<PlausibleAnalytics domain="your-app-domain.com" />Uncomment it and put your own domain into the domain property.
Once you deploy the website, you’ll start seeing data in your Plausible dashboard.
Enable TelemetryDeck analytics
Create an app in your TelemetryDeck dashboard and copy the App ID.
Then open app/(main)/layout.tsx and find the <TelemetryDeckAnalytics>
component, which is commented by default.
<TelemetryDeckAnalytics
appID="your-telemetrydeck-app-id"
clientUser="anonymous"
/>Uncomment it and replace appID with your own value.
By default, this component tracks page views automatically when user navigates the site. It sends the pageView signal with current path.
See <TelemetryDeckAnalytics> reference for all supported options.
Track custom events with useTelemetryDeck()
If you extend AppView with custom components, there is a useTelemetryDeck() hook you can use to send
custom events.
"use client";
import { useTelemetryDeck } from "@/hooks/useTelemetryDeck";
export function DownloadTracker() {
const telemetryDeck = useTelemetryDeck({
appID: "your-telemetrydeck-app-id",
clientUser: "anonymous",
});
async function handleDownloadClick() {
try {
await telemetryDeck.signal("downloadButtonClicked", {
source: "hero",
});
} catch (error) {
console.error("TelemetryDeck custom event tracking failed", error);
}
}
return <button onClick={handleDownloadClick}>Download</button>;
}See useTelemetryDeck() reference for hook options and details.
Enable Vercel Web Analytics
Vercel Web Analytics works only when you deploy your website to Vercel. If you use another hosting provider, use Plausible.
If you plan to deploy your website to Vercel, you can use their built-in web analytics.
First, enable Web Analytics in Vercel dashboard by going to your project → Analytics tab and click “Enable” button.
Now open app/(main)/layout.tsx and find the <VercelAnalytics> component,
which is commented by default. Uncomment it.
<VercelAnalytics />You might need to add import statement at the top of the file in case your editor doesn’t suggest to do it automatically.
import { VercelAnalytics } from "@/components/vercel_analytics/vercel_analytics";Re-deploy the project and you’re all set. You should start seeing data about visitor in the Vercel console.