Install
Install the script
Add one line of code to your site's <head> to start tracking pageviews. No cookies, so no consent banner needed.
- Best for
- Site owners and developers
- Prerequisites
- Access to your site's HTML or template.
Step 1: Copy your site's snippet
Each site has its own snippet with its site ID. Go to your sites, pick the site and copy the snippet from its setup page. It looks like this:
HTML <script async src="https://staging-script.pebbleanalytics.io/s/YOUR-SITE-ID.js"></script>Step 2: Paste it into your site's <head>
Add it anywhere between
<head>and</head>. If your pages share a template, you only need to add it once.HTMLSite template <head> <meta charset="utf-8"> <title>Field Notes</title> <script async src="https://staging-script.pebbleanalytics.io/s/YOUR-SITE-ID.js"></script> </head>The
asyncattribute loads the script without slowing down your page.Step 3: Verify the installation
Visit any page on your site. The pageview appears on the site's setup page and dashboard right away.
Done: You're all set
Every page with the script is now tracked.
Tracking without JavaScript
Use a tracking pixel for visitors with JavaScript turned off, or pages that don't allow scripts.
Add this next to the snippet. Inside <noscript>, it only loads when the script can't run. On pages that don't allow scripts, use the pixel on its own.
<noscript>
<img src="https://staging-script.pebbleanalytics.io/p/YOUR-SITE-ID.gif" alt="" width="1" height="1"
referrerpolicy="no-referrer-when-downgrade">
</noscript>