Add Datsnip to Your Site
One snippet is all it takes. Paste it into your site and every feature — A/B experiments, announcement banners, smart triggers, funnel tracking — turns on immediately.
The snippet
Go to Settings → Install Snippet in your dashboard. You'll see a pre-filled snippet with your unique Site ID. Copy it and paste it into the <head> of every page on your site.
<!-- paste this before </head> on every page -->
<script>
(function(w,d,k){
w._sf = { siteId: k, ingestUrl: 'https://api.datsnip.com' };
var s = d.createElement('script');
s.async = 1;
s.src = 'https://api.datsnip.com/sdk/tracker.js';
d.head.appendChild(s);
})(window, document, 'YOUR_SITE_ID');
</script>
That's it. No other setup needed.
Go to Settings → Install Snippet and your Site ID (sf_...) is already in the snippet, ready to copy.
Where to paste it on common platforms
| Platform | Where to paste |
|---|---|
| Webflow | Project Settings → Custom Code → Head Code |
| Shopify | Online Store → Themes → Edit Code → layout/theme.liquid before </head> |
| WordPress | Use "Insert Headers and Footers" plugin → Scripts in Header |
| Squarespace | Settings → Advanced → Code Injection → Header |
| Framer | Site Settings → Custom Code → End of <head> tag |
| Wix | Settings → Custom Code → Add to Head |
| Plain HTML | Paste before </head> in every page |
| Next.js / React | Your root layout or _document.tsx |
What the snippet does
It loads the Datsnip SDK from api.datsnip.com in the background (async, so it never blocks your page). The SDK then fetches your site's configuration — banners, triggers, page fixes, experiments — and starts capturing behavior such as rage clicks, dead clicks, scroll depth and JavaScript errors.
Add the optional anti-flicker guard from Anti-Flicker so visitors never see the original content flash before a variant applies.
Verify it's working
After pasting and publishing:
- Visit your site in a browser
- Open DevTools → Network tab
- Search for "tracker" — you'll see it load
Or simply go to your Datsnip dashboard — if the snippet is installed correctly, Settings will show your site as active with a green dot.