Start here
Add the script
Paste the Sporetag script tag into your site's head. Steps for plain HTML, WordPress, Shopify, Webflow, Squarespace, Wix and single page apps.
The script is one tag. In Private mode, the default, it sets no cookies and stores nothing in the browser.
<script defer data-site="shop.example.com" src="https://sporetag.com/s.js"></script>Put it in the <head> of every page. data-site is the domain you added in Sporetag.
What the script does
- Counts a pageview once the tab has been visible for 1.5 seconds.
- Sends how long the page was visible when the visitor leaves.
- Follows page changes in single page apps that use the History API.
- Reads UTM tags and ad click ids (
gclid,gbraid,wbraid,fbclid) from the landing address. - Does nothing in automated browsers that report
navigator.webdriver.
Step-by-step guides: Shopify, WordPress, Squarespace, Wix, Webflow, Framer, Google Tag Manager and any other site.
Plain HTML
Paste the tag inside <head> on each page, or in your shared header template.
WordPress
Use your theme's header settings, or a plugin that adds code to the head. Paste the tag as it is. Clear any page cache after you save.
Shopify
In the admin, open Online Store. Next to your theme, click ..., then Edit code. Open theme.liquid and paste the tag just before </head>. Full Shopify guide.
Webflow, Squarespace and Wix
Each has a site wide setting for custom code in the head. Paste the tag there and publish the site. Some of these builders only allow custom code on paid plans.
Single page apps
Load the tag once, in the main HTML file. The script listens for route changes and counts each one as a pageview. You do not need to call anything yourself.
Check it
Open your site, wait a few seconds, then look at the Live count in your dashboard. The same browser counts as one visitor per day.
Ad blockers
Some blockers stop analytics scripts by their address. To count those visits, serve the script from your own domain with a script proxy.
Something missing or wrong? Email hello@sporetag.com.