Skip to content

Analytics

Diggama includes a built-in, privacy-friendly analytics engine. It tracks visitors, sessions, and pageviews without cookies and without third-party services.

Setup

1. Allow your domains

From the Diggama dashboard, go to Project settings > Domains and add the domains that will send analytics data.

Domains should be added without protocol or path. For example, example.com will allow example.com/blog but not www.example.com/blog.

2. Generate a tracking token

Go to Project settings > Tokens and create a new token. Leave the permissions empty — this token is only used to identify your project for the tracking script.

Copy the token and keep it safe.

3. Add the tracking script

Add the following script tag to every page of your site, ideally in your layout component or <head>:

html
<script src="https://api.diggama.com/v1/here.js" x-diggama-token="{token}" async></script>

Replace {token} with your tracking token.

Framework examples:

Astro (src/layouts/Base.astro):

html
<head>
  <script src="https://api.diggama.com/v1/here.js"
          x-diggama-token={import.meta.env.PUBLIC_DIGGAMA_TOKEN}
          async></script>
</head>

Next.js (app/layout.tsx):

html
<Script
  src="https://api.diggama.com/v1/here.js"
  data-x-diggama-token={process.env.NEXT_PUBLIC_DIGGAMA_TOKEN}
  strategy="afterInteractive"
/>

What is tracked

MetricDescription
VisitorsUnique visitors identified by a fingerprint (no cookies)
SessionsA group of pageviews from the same visitor
PageviewsEach page visited
ReferrersWhere visitors came from
Device, browser, countryAggregated demographics
Session durationTime between first and last pageview
Bounce ratePercentage of sessions with a single pageview

Dashboard

Analytics data is available in the Diggama dashboard under the Analytics tab of your project. It shows real-time live users, trends, top pages, referrers, and device breakdowns.

Analytics API

For programmatic access to analytics data (e.g. building custom dashboards), see the Analytics API reference.

Diggama Documentation