Script options
Change how the script behaves by adding data- attributes to the script tag. Only data-site is required.
| Attribute | What it does |
|---|---|
data-site | Your site ID. Required. |
data-auto-events | Counts outbound links, file downloads, email and phone clicks automatically. See Goals and events. |
data-ignore-pages | A comma-separated list of paths to skip. A trailing * matches everything under a path. Nothing is sent from ignored pages, not even events. |
data-hash | Counts #/route changes as pageviews, for apps that use hash-based routing. |
data-api | Sends data to a different endpoint than the one the script was loaded from. |
data-allow-localhost | Counts visits from localhost and 127.0.0.1, for testing. Leave it off in production. |
Examples
Skip admin and account pages
<script defer data-site="YOUR_SITE_ID" data-ignore-pages="/admin*,/account/*,/checkout/success" src="https://vardeanalytics.com/js/script.js"></script>Single-page app with hash routing
<script defer data-site="YOUR_SITE_ID" data-hash src="https://vardeanalytics.com/js/script.js"></script>Exclude your own visits
Open your site with ?varde_ignore=true at the end of any URL, for example https://example.com/?varde_ignore=true. From then on, that browser sends nothing. Do this once on each browser and device you use. To start counting that browser again, visit with ?varde_ignore=false.
This saves a small flag in that one browser's local storage. Nothing is stored on your visitors' devices.
Single-page apps
Apps built with Next.js, React Router, Vue Router, Lovable or Framer change the URL without reloading. The script notices these changes and counts each new path once, so no extra setup is needed.
What the script does not do
- It sets no cookies, stores nothing on your visitors' devices and does no fingerprinting.
- It does not run on
localhost, on local files, in automated browsers, or during page prerendering. - It only reads the page URL, the referrer and the window width (used to tell mobile from desktop).