Add Hark to any website
If you can edit your site's HTML, this is all there is to it. The other guides are this same step, in the place each platform keeps its <head>.
The code below is for example.com. Replace it with your site's domain.
-
1
Paste the snippet into the <head> of every page
If your pages share a header template or include, put it there once. Put it just before </head>.
index.html
<head> <!-- your existing tags --> <script defer data-domain="example.com" src="https://harkstats.com/js/script.js"></script> </head> -
2
Publish, then visit your site
Open your site in a browser. Your site's settings page in Hark shows "Receiving events" as soon as the first pageview arrives.
Not seeing visits?
- Your site's settings page in Hark says "Receiving events" once the first pageview arrives. It updates by itself, so keep it open while you visit your site.
- data-domain must be the domain you added to Hark, without https:// or www.
- Visits from localhost aren't counted. Add a data-local attribute to the tag to test on your machine.
- Check your published page's source for the tag: caching plugins and CDNs can serve an old copy.
- Some ad blockers block analytics scripts, including this one; try another browser to rule that out.
-
To leave your own visits out, run
localStorage.analytics_ignore = "true"in your browser's console on your site.
No site yet? The trial is free, with no card.
Start your free trial