> ## Documentation Index
> Fetch the complete documentation index at: https://www.usenotra.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Analytics integrations

> Send visits on your Notra site to Google Analytics 4, PostHog, Plausible or Umami without adding a script tag.

Every site counts its own visitors and their time on page with nothing to install. Analytics integrations also send each visit to your own analytics tool, so you can report on your blog and changelog in the same place as your product.

## Built-in analytics

Open the site's **Analytics** page for people and AI agents on the site, or **Traffic** in GEO for AI crawlers and referrals across all your domains. Neither page counts visits to previews, and you can turn built-in analytics off under **Settings → Danger zone**. See [AI agents and search](/docs/sites/agents#ai-traffic-analytics).

## How integrations work

You set up a provider in the dashboard or add it under `integrations` in `blog.json`, and both methods write the same configuration. Notra installs the provider's script on every live page and adds the hosts it needs to the [Content-Security-Policy](/docs/sites/custom-scripts#content-security-policy), so you never add a script tag or install an SDK. You can enable several providers at once.

<Note>
  Analytics integrations are disabled on preview deployments and during local development. Custom scripts still run there, so if you install analytics through a [custom script](/docs/sites/custom-scripts), you control when it sends events.
</Note>

## Supported providers

<CardGroup cols={2}>
  <Card title="Google Analytics 4" icon="https://mintcdn.com/notra/DX9q3udSJwpbenJ3/images/integrations/google-analytics.svg?fit=max&auto=format&n=DX9q3udSJwpbenJ3&q=85&s=d32218f161b7a8180846e0c814020825" href="/docs/sites/integrations/analytics/google-analytics" horizontal width="2196" height="2431" data-path="images/integrations/google-analytics.svg" />

  <Card title="PostHog" icon="https://mintcdn.com/notra/DX9q3udSJwpbenJ3/images/integrations/posthog.svg?fit=max&auto=format&n=DX9q3udSJwpbenJ3&q=85&s=c56b8e5cfeafe7ed0969cd1e882cb601" href="/docs/sites/integrations/analytics/posthog" horizontal width="50" height="30" data-path="images/integrations/posthog.svg" />

  <Card title="Plausible" icon="https://mintcdn.com/notra/DX9q3udSJwpbenJ3/images/integrations/plausible.svg?fit=max&auto=format&n=DX9q3udSJwpbenJ3&q=85&s=35a2d500ff2acd2301a028a486e33f85" href="/docs/sites/integrations/analytics/plausible" horizontal width="46" height="60" data-path="images/integrations/plausible.svg" />

  <Card title="Umami" icon="https://mintcdn.com/notra/DX9q3udSJwpbenJ3/images/integrations/umami.svg?fit=max&auto=format&n=DX9q3udSJwpbenJ3&q=85&s=2119d077d41f340051d06a708350228f" href="/docs/sites/integrations/analytics/umami" horizontal width="428" height="389" data-path="images/integrations/umami.svg" />
</CardGroup>

## Set up in the dashboard

<Steps>
  <Step title="Copy your provider's ID">
    Create or select your site in the analytics provider and copy its public ID, using the provider pages above to find it.
  </Step>

  <Step title="Enter the settings">
    In Notra, open **Studio → Sites**, select your site and open **Integrations**. Click **Add** next to the provider and paste its ID into the matching field.

    The dialog shows the corresponding `blog.json` configuration, which you can copy to use the same setup in your repository.
  </Step>

  <Step title="Wait for the draft to save">
    Valid settings save automatically, so there is no Save button. Saving creates a draft of `blog.json` and doesn't create a GitHub commit or change your live site. You can click **Close** to leave the draft for later, or continue with **Create PR** in the same dialog.

    Closing the dialog or navigating within the dashboard finishes a pending save. If saving fails, the dialog stays open so you can retry, and invalid settings show a validation error instead of saving.
  </Step>

  <Step title="Review and publish">
    Click **Create PR** in the provider dialog or the draft bar on the Integrations page. Notra finishes any pending save and opens a preview of all saved drafts, including `blog.json`. Review the changes and commit message, click **Open pull request** and merge the PR into the production branch to deploy it.

    To edit other files or commit directly, click **Open editor**, review the changes and click **Publish → Commit and deploy**. Direct commits are available only when **Settings → Publishing** allows them and the GitHub branch is not protected. Publishing includes the editor's pending changes, so review any other drafts first. See [Publishing and deployments](/docs/sites/publishing#the-editor).
  </Step>

  <Step title="Verify on the live site">
    Wait for a successful production deployment, open your live site and check the provider's incoming traffic. **Draft saved** only confirms that Notra saved the configuration, not that the provider received an event, and a PR preview can't verify analytics because provider scripts are disabled there.
  </Step>
</Steps>

To change a provider, open its options menu and choose **Edit**. **Remove** updates the draft too, and either change only reaches the live site once you publish and deploy it.

## Set up in blog.json

Add the provider to the `integrations` object in `blog.json` at the root of your [site folder](/docs/sites/repository). If the file already exists, add the provider next to your other settings, and use the provider pages for a full example of each.

```json blog.json theme={"system"}
{
  "$schema": "https://usenotra.com/schemas/blog.json",
  "name": "Acme",
  "integrations": {
    "ga4": { "measurementId": "G-ABC123XYZ9" },
    "plausible": { "domain": "blog.acme.com" }
  }
}
```

The `$schema` line enables autocomplete and validation in your editor. Commit the file to your production branch, or open a PR and merge it into that branch, and Notra activates the provider after the production deployment succeeds.

Notra validates provider settings in the dashboard, when saving and during builds. Invalid IDs, unexpected keys and invalid hostnames stop the change with an error. To disable a provider, remove its object, then publish and deploy the configuration. See [`integrations` in blog.json](/docs/sites/reference/blog-json#integrations) for every setting.

## If no events arrive

* Confirm that you published the draft and the production deployment succeeded. A saved draft or an unmerged PR hasn't changed the live site.
* Test the live URL, not a PR preview, branch preview or local development server.
* Check that the ID belongs to the provider site or project whose dashboard you're viewing. For PostHog, also check the US or EU **API host**.
* Temporarily disable your browser's analytics blocker for the test and check the Network tab for failed provider requests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.