Local development
On localhost the script sends nothing, so development doesn't skew your stats. Two steps turn tracking on there.
Replace
YOUR_SITE_ID with your site ID in Datrika. Copy the script with the ID filled in from your site settings, on the General tab.Turn on tracking
The script switches itself off on localhost, 127.0.0.1 and .local domains. To test the installation locally, do both:
- Add the
data-devattribute to the script, whether you put it inindex.htmlor in theScriptcomponent in Next.js. - In your site settings on the General tab, add the address your site runs on locally, such as
localhost, to Additional domains.
<script defer
src="https://cdn.datrika.app/da.js"
data-datrika
data-dev
data-site-id="YOUR_SITE_ID">
</script>