Written by.
Date published
May 27, 2025
📌 What it's for
TikTok Pixel is your primary source of data about user actions on the website. You can use it to:
- Optimize ad campaigns for real actions, not just displays
- Run retargeting on those who have already shown interest
- Measure which creatives and audiences are actually delivering results
If you are driving traffic from TikTok but not using the pixel - you lose control of the funnel.
How to install a pixel
1. Create a pixel in TikTok Ads Manager
- Go to TikTok Ads Manager
- From the menu on the left, select "Events manager"
- Click on "Connect datasource."
- Choose the right option
- Enter the name of the site
- Select Manual install (if you will be inserting the code manually) or Partner Integration (if working through CTM or Shopify).
2. If you chose manual installation - add the base pixel code to the site
TikTok will generate the code. Paste it in front of </head>
on all pages of the site:
<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"];
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 i = "https://analytics.tiktok.com/i18n/pixel/events.js";
ttq._i = ttq._i || {};
ttq._i[e] = [];
ttq._i[e]._u = i;
ttq._t = ttq._t || {};
ttq._t[e] = +new Date;
ttq._o = ttq._o || {};
ttq._o[e] = n || {};
var o = document.createElement("script");
o.type = "text/javascript";
o.async = !0;
o.src = i + "?sdkid=" + e + "&lib=" + t;
var a = document.getElementsByTagName("script")[0];
a.parentNode.insertBefore(o, a)
};
ttq.load('YOUR_PIXEL_ID');
ttq.page();
}(window, document, 'ttq');
</script>
3. Set events
Can be configured through:
- Event Builder (visually, without code) - as in Meta
- Manually through the code
- Through integrations (e.g. Shopify, GTM)
📦 Key events for e-commerce
Event | Assignment |
ViewContent | View product card |
AddToCart | Adding to cart |
InitiateCheckout | Start order placement |
CompletePayment | Buying |
Search | Search the site |
An example of a "Purchase" event:
<script>
ttq.track('CompletePayment', {
value: 49.99,
currency: 'KZT'
});
</script>
✅ Checking
- Go to the Diagnostics tab in the Events Manager
- Verify that events are transmitted and displayed
- You can install the TikTok Pixel Helper browser extension
More useful articles
From TikTok to WhatsApp: how to increase conversions
From TikTok to WhatsApp: how to increase conversions
March 11, 2025
TikTok
How to conquer TikTok with the Planning Inspiration Toolkit
How to conquer TikTok with the Planning Inspiration Toolkit
March 3, 2025
TikTok
How to attract quality leads with Instant Forms from Meta
How to attract quality leads with Instant Forms from Meta
March 4, 2025
Meta
TikTok Pixel installation: accurate tracking, more conversions
TikTok Pixel installation: accurate tracking, more conversions
May 27, 2025
TikTok
Meta Pixel installation: how to ensure accurate tracking and management of your sales funnel
Meta Pixel installation: how to ensure accurate tracking and management of your sales funnel
May 27, 2025
Meta
How targeters can launch ads in new markets
How targeters can launch ads in new markets
May 13, 2025
WebinarTelegram AdsMeta