TikTok Pixel
Adds the TikTok Pixel to every page, for TikTok ads measurement. Visits by administrators aren’t counted.
Before you switch it on: Replace YOUR_PIXEL_ID with your pixel ID from TikTok Ads Manager > Assets > Events.
It arrives switched off, even when you install its whole pack with "Switch on after installing".
<!-- TikTok Pixel -->
<script>
!function (w, d, t) {
w.TiktokAnalyticsObject = t; var ttq = w[t] = w[t] || []; ttq.methods = ['page','track','identify','instances','debug','on','off','once','ready','alias','group','enableCookie','disableCookie','holdConsent','revokeConsent','grantConsent'];
ttq.setAndDefer = function (t, e) { t[e] = function () { t.push([e].concat(Array.prototype.slice.call(arguments, 0))) } };
for (var i = 0; i < ttq.methods.length; i++) ttq.setAndDefer(ttq, ttq.methods[i]);
ttq.instance = function (t) { for (var e = ttq._i[t] || [], n = 0; n < ttq.methods.length; n++) ttq.setAndDefer(e, ttq.methods[n]); return e };
ttq.load = function (e, n) { var r = 'https://analytics.tiktok.com/i18n/pixel/events.js'; ttq._i = ttq._i || {}; ttq._i[e] = []; ttq._i[e]._u = r; ttq._t = ttq._t || {}; ttq._t[e] = +new Date; ttq._o = ttq._o || {}; ttq._o[e] = n || {}; var s = d.createElement('script'); s.type = 'text/javascript'; s.async = !0; s.src = r + '?sdkid=' + e + '&lib=' + t; var a = d.getElementsByTagName('script')[0]; a.parentNode.insertBefore(s, a) };
ttq.load('YOUR_PIXEL_ID');
ttq.page();
}(window, document, 'ttq');
</script>
Good to know
In the EU, load it only after consent: use your cookie banner or Snipfire Pro’s cookie consent setting.
Comes with a rule
It doesn't run for administrators, so your own visits don't count in your statistics. You can change the rule after installing.
In these packs
- More tracking codes: Google Ads, TikTok, LinkedIn, Pinterest, Hotjar, Plausible, site verification and a GA4 purchase event.