Skip to content Skip to sidebar Skip to footer

How to Implement the TikTok Pixel (and Not Lose 30% of your Conversions)

set up tiktok pixel

Table of Contents

Before I explain how to implement the TikTok Pixel step by step, I need to tell you something that most guides don't tell you: installing the pixel is not enough.

There is a silent problem that is affecting almost every company advertising on TikTok right now. A problem that you can't see in the ad dashboard, but is inflating your CPAs, confusing the algorithm and causing you to make investment decisions based on incomplete data.

By the end of this article you will understand exactly what that problem is, why the pixel alone doesn't solve it, and how to implement it all correctly from the beginning.

What is the TikTok Pixel and what is it for?

The TikTok Pixel is a piece of JavaScript code that is placed on your website. When a user visits your page, the pixel is activated and sends information to TikTok about what that user is doing.

With that information, TikTok can do three things for you:

  • Measuring conversions: Know how many purchases, registrations or leads come from your ads.
  • Optimize campaigns: TikTok's algorithm learns which users convert the most and shows them your ads.
  • Creating audiences: You can remarket to people who have already visited your website, or create audiences similar to your buyers.

Without the pixel, no attribution is possible. The TikTok algorithm is working blind, and so are you.

The two types of pixel that TikTok offers

TikTok distinguishes two modes of implementation. It is important that you know them before you start.

Standard Mode (Event Builder)

In this mode you define the events directly from the TikTok Ads Manager panel, without touching code. This is the simplest option. It works for advertisers who do not have technical resources or are just starting out.

Its limitation: you have less control over the parameters you send and less flexibility to measure complex events.

Developer Mode (Custom Code)

This mode allows you to send additional parameters along with each event: product price, currency, product ID, hashed user data for Advanced Matching, etc. It is the recommended option if you want clean data, real ROAS and quality audiences.

This mode requires technical knowledge or a team that knows what it does. It is the one we recommend at Analytic Pixel Pro for all implementations.


How to create your TikTok Pixel: step by step

Step 1: Access the Event Manager

Enter in TikTok Ads Manager with your advertiser account. In the top menu, go to Assets > Events. There you will find the web events section.

Step 2: Create a new pixel

Click on Configure web events and select the option to create a TikTok Pixel. TikTok will ask you to name it. Use the name of your domain or website. It is easier to identify when you have multiple pixels.

Step 3: Choose the installation method

TikTok offers you two routes:

  • Partner integration (Shopify, Google Tag Manager, etc.)
  • Manual configuration

For the majority of companies with a serious digital presence, installation via Google Tag Manager in developer mode is the right choice. It gives you full control over which events you trigger and when.

Step 4: Copy the pixel base code

TikTok generates a JavaScript code snippet for you. This code base must be present in all pages of your website. It is placed in the <head> of the HTML.

If you use GTM, create a custom HTML tag, paste the pixel code and assign it the trigger All pages.

Step 5: Configure standard events

Events are the actions you want to measure. TikTok has a list of standard events designed for ecommerce and digital businesses:

EventWhat it measures
PageViewVisit any page
ViewContentA user sees a product
AddToCartAdd product to cart
InitiateCheckoutStart of the payment process
AddPaymentInfoUser enters payment data
CompletePaymentPurchase completed
CompleteRegistrationRegistration completed
SubmitFormForm Submission
SearchSearch within the site

For an ecommerce, as a minimum you should implement ViewContent, AddToCart, InitiateCheckout y CompletePayment with its value parameters (price and currency). Without those parameters, you cannot calculate real ROAS.

Step 6: Verify that everything works

TikTok offers two tools to verify the installation:

  • TikTok Pixel HelperChrome extension that shows in real time what events are triggering on your page and if there are errors.
  • Test EventsEvent Manager: inside the Event Manager you can see the events that arrive in real time as you browse your website.

Don't post without verifying. A poorly installed pixel is worse than no pixel.


The problem no one tells you about: ad blockers

Here is the silent problem I mentioned at the beginning.

The TikTok Pixel works from the user's browser. That means if the user has an ad blocker, a browser that blocks third-party scripts, or privacy restrictions enabled, pixel does not fire. This conversion does not reach TikTok.

How many conversions are lost this way? Ad blockers affect approximately 30% of users on desktop browsers. In some technology sectors, that figure is even higher.

The result: TikTok sees fewer conversions than actually occur, the algorithm learns worse, your CPAs look higher than they are, and you end up making investment decisions with incomplete data.

The solution: Pixel + Events API (the combo you should use).

The Events API (or TikTok CAPI) is the solution to the above problem. Instead of sending the conversion data from the user's browser, you send it to the user's browser. from your server directly to the TikTok server.

Blockers cannot intervene. Third party scripts do not matter. The signal arrives in one piece.

TikTok recommends using the Pixel and the Events API together, in what is called an architecture web + server-side.

How deduplication works

When you use both methods at the same time, the same event can reach TikTok twice: once from the browser and once from the server. To prevent TikTok from counting that conversion twice, you have to use a parameter called event_id.

The event_id is a unique identifier that you assign to each event. If TikTok receives two events with the same event_id, treats them as one. So simple in theory, so easy to break if not implemented well.

How to implement the Events API with Google Tag Manager Server-Side

This is the recommended implementation for companies with traffic volume and ongoing campaigns. It is not the fastest to set up, but it is the most robust.

What you need

  • A container Web of GTM (the one you already have)
  • A container Server GTM (hosted on your own server or on a service such as Stape)
  • Your Pixel ID of TikTok
  • A Access Token generated from TikTok Ads Manager

Data flow

  1. The user visits your website → the web pixel fires the event in the browser and sends it to the GTM server container.
  2. The server container receives the event → processes it and sends it to TikTok via the Events API.
  3. Both events have the same event_id → TikTok deduplicates and counts only one.

GTM Server configuration

In your server container, create a tag using the template TikTok Events API (Official) available in the Community Template Gallery. Enter your Access Token and your Pixel ID. Map the event parameters (event name, value, currency, user data).

User data such as email or phone number must be sent hashed with SHA-256 to comply with privacy and improve match quality with TikTok profiles.

Why this improves your campaigns

The match quality determines how accurately TikTok can match your conversion event with a TikTok user. The more user data you send (hashed), the better the match quality. Better match quality means that the algorithm learns better and your campaigns are optimized faster.

Advanced Matching: enriches the data you send

Advanced Matching allows you to send hashed user data along with each event: email, phone number, name, city. TikTok uses this data to cross-reference it with its user database and improve attribution.

This feeds the optimization algorithm better and improves the quality of your remarketing audiences. If your platform allows you to collect the user's email at some point in the funnel (checkout, registration, etc.), you should send it hashed in SHA-256 with each relevant event.

The ttclid: the data you must not miss

When a user clicks on a TikTok ad, TikTok automatically appends a parameter to the destination URL named ttclid. It is the click identifier, valid for 30 days.

If you keep that ttclid in a cookie of your own and send it along with your conversion events to the Events API, TikTok can attribute that conversion to the correct campaign even if it takes days for the user to convert. Without it, that attribution can be lost.

It's a small technical detail with a huge impact on the quality of your attribution data.

What events should you set up in your business

The answer depends on your business model.

If you are ecommerce: Implement the entire funnel: ViewContentAddToCartInitiateCheckoutAddPaymentInfoCompletePayment. All with value parameters (price, currency, content_id, content_type). If you have a product catalog, connect it to enable dynamic ads.

If you are SaaS: PageView + CompleteRegistration for signup → key trigger events within the app if you can send them. The goal is to give enough signal to the algorithm to find users with high probability to convert.

If you generate leads: SubmitForm o CompleteRegistration as the main conversion event. Consider also sending qualified lead events from your CRM through the Events API when lead quality data allows it.

Common mistakes that ruin an implementation

There are errors that we see repeatedly when auditing implementations. Here are the most frequent ones:

Pixel installed only in the home: The code base should be on all pages, not just the main page.

Events without value parameters: An event CompletePayment without price or currency tells the algorithm nothing about the value of that conversion.

Duplication of events without event_id: If you use pixel and Events API without event_id, TikTok counts double. Your conversion metrics are inflated and the algorithm learns wrong.

Do not save the ttclid: If you do not capture the click parameter in your own cookie, you lose attribution for conversions that occur days after the first click.

Do not verify before publishing: Implementing without verifying with the Pixel Helper or the Test Events tool is a blind bet.

Privacy and compliance: what you should know

If you operate in Europe or handle European user data, the TikTok Pixel and Events API collect personal data. That implies obligations under the GDPR.

At a minimum you need:

  • A cookie consent banner that blocks the pixel until the user accepts.
  • Do not send personal data without prior consent.
  • Review TikTok's Commercial Product Terms.

A pixel implementation that does not respect the GDPR is not a correct implementation, however technically perfect it may be.

On the server, user data must be hashed before being sent, never in plain text.

When does it make sense to delegate implementation

If you've been reading up to this point, it's probably clear to you that this is not just copying and pasting code.

A correct implementation of the TikTok Pixel with Events API involves:

  • Web architecture + server-side with GTM container server
  • Successful deduplication with event_id
  • Capturing and sending the ttclid
  • Advanced Matching with hashed data
  • Verification of each event with its parameters
  • Privacy compliance with consent management

If your company invests in advertising on TikTok and you need that data to be reliable to scale, it makes much more sense to delegate it to a specialized team than to do it half-heartedly and live with broken data.

At Analytic Pixel Pro We implement the full TikTok tracking (Pixel + Events API) along with GA4, GTM and the rest of the pixels you use, making sure everything is properly configured, deduplicated and privacy compliant. The goal is that you can scale your ad spend with data you can trust.

Whether you want us to audit your current implementation or assemble the architecture from scratch, contact us at analyticpixelpro.com.


Summary: key points

The TikTok Pixel is only the first step. To measure well you need:

  1. Pixel in developer mode, with standard events and value parameters on all relevant pages.
  2. Events API (server-side), to recover the conversions that ad blockers hide from the pixel.
  3. Successful deduplication with event_id, so that TikTok does not count double.
  4. Capture of the ttclid, to avoid losing attribution of deferred conversions.
  5. Advanced Matching, to improve match quality and algorithm learning.
  6. Consent management, in order to comply with the RGPD.

With that architecture, TikTok's algorithm has the full signal it needs to optimize. And you have the data you need to make investment decisions with confidence.

Picture of Silvestre Rojas

Silvestre Rojas

I am Silvestre, expert in Web Analytics and Tracking. I help you optimize your site's performance, providing you with accurate data to make informed decisions and reach your goals with ease.