# How to Set Up the TikTok Pixel and Events API on Shopify {#post-title}

[cPixel](/blog/#blog-cpixel)

By [B2B Gold](/about/#how-we-write) Published 24 September 2026 Updated 25 September 2026

## How do you add the TikTok pixel to Shopify? {#how-do-you-add-the-tiktok-pixel-to-shopify}

Install the TikTok app for Shopify, connect your TikTok accounts and choose a data-sharing level: Standard adds the TikTok Pixel, while Enhanced and Maximum add TikTok’s Events API and Advanced Matching, all without code. Use a tracking app instead when you need several pixels or want to see each event TikTok receives, and keep one sender per pixel.

TikTok’s own [set-up guide](https://ads.tiktok.com/help/article/shopify-set-up-guide) (last updated February 2025) describes the steps. Shopify’s pages about TikTok cover TikTok Shop rather than the pixel, so TikTok’s help centre is the reference here.

1. Install TikTok’s app from the Shopify App Store, then open **TikTok** under **Sales channels** in your Shopify admin.
2. Connect or create the TikTok accounts the app asks for, including your **TikTok for Business** account and **TikTok Ads Manager**.
3. Choose your level of data sharing: **Standard**, **Enhanced** or **Maximum**.
4. Click **Create Pixel** to make a new pixel, or select an existing one.
5. Click **Set Up**, add your business location under **Company Information**, and click **Confirm**.

The app installs the pixel for you, so there is nothing to paste. If TikTok’s base code is also in your theme or a custom pixel from an earlier setup, remove it, or every event is sent twice.

## Which data-sharing level should you choose? {#which-data-sharing-level-should-you-choose}

Enhanced or Maximum, unless you want to share less data with TikTok: only those levels include the Events API, which TikTok recommends running alongside the pixel. Standard is the pixel on its own.

| Level | What TikTok says it uses | Events API | Advanced Matching |
| --- | --- | --- | --- |
| Standard | TikTok Pixel | No | No |
| Enhanced | TikTok Pixel, Events API and Advanced Matching | Yes | Yes |
| Maximum | Everything in Enhanced, plus Shopify APIs and In-App Shopify Checkout (in beta) | Yes | Yes |

Source: TikTok’s [data sharing article](https://ads.tiktok.com/help/article/data-sharing-tiktok-app-shopify) (last updated February 2025), checked 24 September 2026.

Advanced Matching sends customer details, such as email address and phone number, with your events so TikTok can match them to TikTok users. When TikTok expanded its Shopify integration in August 2023, it asked existing users to check in the TikTok app that their level was Enhanced or Maximum ([TikTok](https://ads.tiktok.com/business/en-US/blog/shopify-ecommerce-integration-pixel-events-api)). Higher levels share more of your customers’ data, so make sure your privacy notice covers what you choose.

## What does the Events API add? {#what-does-the-events-api-add}

A server-to-server copy of your events, so a conversion still reaches TikTok when the browser pixel fails. TikTok recommends it as a second channel next to the pixel, not a replacement, with the two copies deduplicated.

TikTok’s reasoning: connection problems and differences between browsers cost the pixel some conversions, and with both channels running, events keep arriving through one when the other fails ([About Events API](https://ads.tiktok.com/help/article/events-api), [web setup guide](https://business-api.tiktok.com/portal/docs/setup-guide-for-web/v1.3)). A server event is only as useful as what it carries:

- **An access token.** You generate it in TikTok Events Manager, from your pixel’s **Settings**.
- **The pixel’s event ID.** A server copy with the same event name and event ID as the browser copy counts once. Without them, TikTok can count both.
- **Matching details.** TikTok matches web events on the TikTok click ID (`ttclid`), Advanced Matching data such as email and phone, and signals such as the IP address and user agent. Its setup guide also asks you to send the click ID and cookies, and to switch on first-party cookies and Automatic Advanced Matching in the pixel’s **Settings** tab.

What the Events API can’t do is bring back shoppers who declined tracking. Sending their events from a server instead of a browser doesn’t make them consented. More on what server events change, and what they don’t: [server-side tracking on Shopify](/blog/server-side-tracking-shopify/).

## How do you set it up with a tracking app? {#how-do-you-set-it-up-with-a-tracking-app}

Connect the app to your pixel with an Events API access token, and make sure nothing else sends to that pixel. A tracking app earns its place when you run several pixels or want to see each event TikTok receives.

cPixel, which we build, sends TikTok’s events from its servers through the Events API: page views, product views, searches, add-to-carts, checkouts, added payment details and the purchase. It builds the purchase from Shopify’s order, so it doesn’t depend on the Thank you page loading. Its storefront tag, which runs when cPixel’s app embed is on in your theme, adds only the page view, paired with the server copy under one event ID. Events carry the details TikTok matches on, where cPixel has them: hashed email and phone once the shopper has given them, hashed Shopify customer and device IDs, the `_ttp` cookie, the `ttclid` click ID, the IP address and the user agent.

In cPixel’s setup you paste the **Pixel code** (TikTok calls it the Pixel ID) and the **Events API access token**, which cPixel requires. With a **Test event code (optional)** saved, **Test connection** sends one real test event; real orders never carry the code. Once events flow, cPixel’s Live view shows each send with TikTok’s reply. You can connect several TikTok pixels, each set up the same way. Step by step: [connect TikTok to cPixel](/docs/cpixel/connect-tiktok/).

If the TikTok app keeps sending to the same pixel, answer **Yes** to cPixel’s question **Is the official TikTok app also installed?**, which stops cPixel sending to that pixel, or connect cPixel to a different pixel. Keep the TikTok app itself either way; the rule is [one sender per pixel](/docs/cpixel/official-channel-apps/). More about [cPixel, which sends Shopify purchases to seven ad platforms](/shopify/cpixel/).

## Why does TikTok count purchases twice? {#why-does-tiktok-count-purchases-twice}

Because two copies of one purchase reached the same pixel without the same event name and event ID, so TikTok couldn’t tell they were one order. That usually means two tools send to one pixel.

TikTok’s rule, from its [developer documentation](https://business-api.tiktok.com/portal/docs/event-deduplication/v1.3) (checked 24 September 2026): events with the same pixel, event name and `event_id` are duplicates. TikTok keeps the first, discards copies received within 48 hours of it, and tries to merge details from a copy received within 5 minutes into the first. Its help article on [event deduplication](https://ads.tiktok.com/help/article/event-deduplication) (last updated May 2025) gives the same 48-hour window.

When the server copy has no event ID, TikTok falls back on the `_ttp` cookie, with limits: it drops a server event only if a browser event with the same pixel, event and cookie arrived up to 5 minutes earlier, and it never drops a browser event.

| Second source | How to spot it | Fix |
| --- | --- | --- |
| The TikTok app and a tracking app on one pixel | Events Manager shows more purchases than Shopify has orders | Let one of them send to that pixel |
| TikTok’s base code in your theme or a custom pixel, as well as the app | The pixel code appears in your theme files or under **Customer events** | Remove the extra copy |
| Pixel and server copies with different event IDs or names | Browser and Server both count the purchase, but Server & Browser stays low | Send the same event name and ID from both |

Meta’s rule and the checks for a Meta pixel are in [TikTok and Meta counting purchases twice](/blog/duplicate-purchases-meta-shopify/).

## How do you test TikTok events? {#how-do-you-test-tiktok-events}

Send test events from the Test Events tab in TikTok Events Manager while you set up. Then place a real order and check each event’s connection method on the pixel’s Overview tab: Browser, Server, or Server & Browser.

1. In TikTok Events Manager, open your pixel and its **Test Events** tab, where you can test browser and server events and filter between them ([TikTok](https://ads.tiktok.com/help/article/tiktok-events-manager-monitor-and-diagnose)).
2. For server events, copy the test code from **Test Events** and send it as `test_event_code` with your requests. Test events show under **Event Activity**, with any payload problems. Remove the code before you go live ([verification guide](https://business-api.tiktok.com/portal/docs/events-api-v2-web-setup-verification/v1.3)).
3. Place a real order.
4. On the pixel’s **Overview** tab, read the **Connection Method** for each event. **Server & Browser** counts an event received through both channels once. If that figure stays low while both channels send the event, check that both copies carry the same event ID.
5. Check the **Diagnostics** tab, which lists problems TikTok has found and how severe they are.

TikTok says event data isn’t shown in real time. Allow up to 10 minutes for event counts to update, and up to 2 hours for an event to be fully processed, before deciding something is broken ([TikTok](https://ads.tiktok.com/resources/help/article/how-to-troubleshoot-pixel-visibility-in-tiktok-ads-manager)). An event also shows as active only once it has fired: in a 2023 Community [thread](https://community.shopify.com/t/why-isnt-my-tiktok-pixel-tracking-product-additions/239589), a merchant using TikTok’s app saw only page views marked active, and the other events appeared after product views and add-to-carts had happened.

If TikTok Pixel Helper shows nothing, the causes are the same as Meta’s: see [TikTok Pixel Helper shows nothing](/blog/meta-pixel-helper-not-working/).

## Frequently asked questions {#frequently-asked-questions}

### CompletePayment or Purchase? {#completepayment-or-purchase}

Purchase, for anything you set up now. TikTok renamed CompletePayment to Purchase for web events from 1 May 2025, and its Events API [list of supported events](https://business-api.tiktok.com/portal/docs/supported-events/v1.3) now shows Purchase. Existing setups needn’t change: TikTok converts the old names automatically and shows the new ones in reporting ([updated standard events](https://ads.tiktok.com/resources/help/article/how-to-adopt-tiktoks-updated-standard-events)). Whichever name you use, send the same one from the pixel and the Events API, because the name is part of TikTok’s deduplication key. cPixel still sends CompletePayment, which TikTok accepts and reports as Purchase; it sends the purchase from its server only, so there’s no browser copy whose name must match.

### What is ttclid? {#what-is-ttclid}

TikTok’s click ID, a parameter TikTok adds to your landing-page URL when someone clicks your ad. The TikTok Pixel saves it in a first-party cookie named `ttclid`, and TikTok strongly recommends sending it with every Events API event so conversions tie back to the click. If you store it yourself, TikTok suggests keeping it for 28 days or more and replacing it when a newer click arrives ([Send TikTok Click ID](https://business-api.tiktok.com/portal/docs/send-tiktok-click-id-ttclid/v1.3)). Its companion, the `_ttp` cookie, holds an identifier for the browser. TikTok says both cookies last 13 months from their last use, and first-party cookies are on by default in the pixel’s settings ([cookies](https://ads.tiktok.com/help/article/using-cookies-with-tiktok-pixel)).

### Can I add the pixel by hand? {#can-i-add-the-pixel-by-hand}

Yes, as a custom pixel under **Settings** → **Customer events**, which reaches the checkout and Thank you page. Shopify notes that custom pixels need JavaScript and aren’t supported by Shopify ([custom pixels](https://help.shopify.com/en/manual/promoting-marketing/pixels/custom-pixels)). Code pasted into your theme runs only on [non-checkout pages](https://shopify.dev/docs/storefronts/themes/architecture/layouts), and Additional scripts no longer run on the Thank you page ([Additional scripts stopped running](/blog/shopify-additional-scripts-tracking/)). A hand-added pixel sends from the browser only, since the Events API needs a server. If you move a pixel, remove the old copy: Shopify names tracking the same event more than once as a common migration problem ([migrating pixels](https://help.shopify.com/en/manual/promoting-marketing/pixels/pixel-migration)).

[cPixel Facebook Pixel CAPI GA4](/shopify/cpixel/)

cPixel is a Shopify app that sends your store’s events to Meta, TikTok, Google Analytics 4 and OpenAI’s ChatGPT Ads from shoppers’ browsers and from its own servers, with one shared event ID so each platform can keep a single copy. A live view shows each send, with the platform’s reply to server sends, and alerts flag a rejected token or stalled tracking.

[Install free on the Shopify App Store](https://apps.shopify.com/cpixel?utm_source=b2bgold.app&utm_medium=referral&utm_campaign=blog&utm_content=blog/tiktok-pixel-shopify&utm_term=post-cta) [Plans and pricing](/shopify/cpixel/#pricing) [cPixel docs](/docs/cpixel/)

Need help with cPixel? Email [support@b2bgold.app](mailto:support@b2bgold.app).

## More on cPixel {#related-heading}

- 24 September 2026 **[Shopify Additional Scripts Stopped? Fix Purchase Tracking](/blog/shopify-additional-scripts-tracking/)** Since 26 August 2026, Shopify's Thank you page no longer runs Additional scripts or script tags on any plan. See what broke and how to move tracking to pixels.
- 24 September 2026 **[How to Set Up the Conversions API on Shopify](/blog/shopify-conversions-api/)** Set up Meta's Conversions API on Shopify with the Facebook & Instagram app or a tracking app, and see how TikTok, Google, Pinterest and ChatGPT Ads compare.
- 24 September 2026 **[How to Track ChatGPT Ads Conversions on Shopify](/blog/chatgpt-ads-conversion-tracking-shopify/)** Track ChatGPT Ads conversions on Shopify with OpenAI's own app, a custom pixel or a tracking app, send purchases through the Conversions API, and check them.
