Notra
Notra Sites has Databuddy built in, so you turn it on with your Client ID instead of adding a script.
Turn on Databuddy
Copy your Client ID
In the Databuddy dashboard, open your Notra website and copy the Client ID from Settings → General.
Add it in Notra
Publish
Notra saves your settings as a draft of blog.json. Choose Review and publish, then merge the pull request. When the production deploy finishes, your visits appear on the dashboard.
Previews and local development don't send events, so test on the live website.
Change what's tracked
blog.json also takes trackAttributes, samplingRate, skipPatterns, maskPatterns, and a scriptUrl or apiUrl for serving Databuddy from your own domain. Notra adds those hosts to your website's Content-Security-Policy for you. The Notra Databuddy guide lists every option with its default.
Track clicks in your pages
With trackAttributes on, name links and buttons in your MDX:
<a href="/pricing" data-track="pricing_clicked" data-placement="changelog-footer">See pricing</a>Each click sends pricing_clicked with the element's other data-* attributes as properties.
Related
How is this guide?