Built for Shopify & WooCommerce · Tracking checked every 30 minutes.

How to install TikTok Pixel on Shopify with Google Tag Manager (all events, no app)

Abir Molla
Abir MollaNov 20, 2026 · 10 min read
How to install TikTok Pixel on Shopify with Google Tag Manager (all events, no app)Video · 16:56 · plays from YouTube

To install the TikTok Pixel on Shopify with Google Tag Manager, you add a data layer to your store as a custom pixel under Settings → Customer events, then build one TikTok Pixel tag in Google Tag Manager for each event: ViewContent, AddToCart, InitiateCheckout and Purchase. Each tag reads the product IDs, value and currency from the data layer, sends the customer's email and phone for advanced matching, and carries an event ID. No TikTok app is needed.

The video above shows the whole setup on a Shopify store, from creating the pixel to testing it with TikTok Pixel Helper. This post is the written version: the steps in order, what to put in each tag, and the double-counting trap to check before you start.

One thing has changed since the video. I recorded it in March 2024. In it, I paste the data layer into theme.liquid and the checkout's Additional scripts box. That way no longer works for the checkout. Shopify made Additional scripts read-only on August 28, 2025, and every store has now moved to the new Thank you and Order status pages, where tracking has to come from app pixels or custom pixels (Shopify Help Center, upgrade guide). So in Step 2 below, the data layer goes in as a custom pixel instead. Everything you build in Google Tag Manager stays the same as in the video.

Why Google Tag Manager instead of the TikTok app

Shopify's TikTok sales channel can install the pixel for you. It's quick, but you can't choose what each event sends, and it's hard to see what went wrong when the numbers look off.

With Google Tag Manager, every tag, trigger and event lives in one container. You decide what goes with each event, test it all in Preview mode, and add other platforms, such as Meta, Google Ads and GA4, from the same data layer. If you've already set up Meta this way, most of the work is done: see how to install the Facebook Pixel on Shopify with Google Tag Manager, then come back for the TikTok tags.

What you need

  • A TikTok Pixel. You create it in TikTok Events Manager in Step 1. This guide shows where to find the Pixel ID.
  • A Google Tag Manager account with a Web container for your store.
  • A Shopify data layer script made for custom pixels. It listens to what happens on your store and pushes GA4-style events to Google Tag Manager: view_item, add_to_cart, begin_checkout and purchase, with the products, order value, currency and customer details.
  • Admin access to your Shopify store, to add a custom pixel.

The events this setup sends to TikTok:

  • Pageview on every page, from the pixel's base code.
  • ViewContent when someone views a product.
  • AddToCart when someone adds a product to the cart.
  • InitiateCheckout when someone starts checkout. The video skips this one, but it's worth adding: it tells TikTok who got close to buying.
  • Purchase when an order is completed. This is the event TikTok uses to find more buyers.

TikTok renamed CompletePayment to Purchase in 2025. Old setups keep working, because TikTok converts the old name on its side, but new setups should use Purchase (TikTok Business Help Center, updated standard events). The video picks CompletePayment, which still lands as a purchase.

Before you start: check the TikTok app

This is where most double counting on Shopify comes from. If the TikTok sales channel is connected to the same pixel, it already sends events from your store. At the Enhanced and Maximum data sharing levels it also sends them through the Events API, TikTok's server-side connection (TikTok Business Help Center, data sharing on the TikTok app on Shopify).

Add your Google Tag Manager tags on top of that and the same purchase reaches TikTok twice, with different event IDs. TikTok can't tell they're the same order, so your results look doubled.

Open the TikTok app in your Shopify admin and check its data sharing settings. Pick one source of events for each pixel: either the app or your Google Tag Manager setup, not both. While you're there, remove any old TikTok code from theme.liquid.

Step 1: create your TikTok Pixel

If you already run TikTok ads, you probably have a pixel. Use that one; don't make a new one.

If you don't have one, sign in to TikTok Ads Manager and go to Tools → Events. Choose to connect a new data source, pick Web, then Manual setup, and give the pixel a name. Copy the Pixel ID it shows.

Then open the pixel's Settings:

  • Turn on Automatic Advanced Matching for email and phone. It's a backup to the details you'll send from the data layer in Step 4.
  • In the video I also turn on first-party cookies, which helps TikTok recognise the same visitor across pages.

Last, copy the pixel's base code from the install page. You'll paste it into Google Tag Manager in Step 4.

Step 2: add the Shopify data layer as a custom pixel

This is the step that changed. Don't paste anything into theme.liquid or Additional scripts.

In your Shopify admin, go to Settings → Customer events and click Add custom pixel. Give it a name, such as "Shopify data layer", and click Add pixel.

Set the two Customer privacy options first:

  • Permission. Choose Required if you sell to places with strict privacy laws, such as the EU or UK, so your consent banner decides when it runs. Not required makes it run for every visitor.
  • Data sale. Choose the option that fits your business.

Then clear the placeholder code, paste your data layer script, and replace the Google Tag Manager container ID inside it with your own (it starts with GTM-). Click Save, then Connect. A saved pixel tracks nothing until it's connected.

Google Tag Manager now runs on your store through Shopify's customer events, including the checkout and the Thank you page.

If you already have this custom pixel from a Meta or GA4 setup, skip this step. One data layer can feed every platform.

Step 3: create the variables and triggers

Build these in Google Tag Manager before the tags, because the tags use them.

Variables. Go to Variables → New and create a Data Layer Variable for each value the TikTok tags need. In the video:

  • customer.email, customer.phone and customer.id for advanced matching.
  • ecommerce.currency for the currency.

Add one more: a Constant variable holding your TikTok Pixel ID. If the ID ever changes, you change it in one place.

If your data layer sends an event ID with each event, add a Data Layer Variable for that too. You'll use it in Step 4.

Triggers. Create a Custom Event trigger for each event the data layer pushes. The event name must match exactly, letter for letter:

  • view_item
  • add_to_cart
  • begin_checkout
  • purchase

Step 4: build the TikTok Pixel tags

The base code tag. Create a Custom HTML tag, paste the TikTok base code from Step 1, and set it to fire on Initialization - All Pages. The base code loads the pixel and sends a Pageview. TikTok's Google Tag Manager template needs the base code to be on the page first.

The event tags. For each event, create a tag with the TikTok Pixel template from the Community Template Gallery (search for "TikTok"). Start with Purchase, because it matters most:

  • Event name: Purchase. If your version of the template only lists CompletePayment, pick that; TikTok treats it as Purchase.
  • Pixel ID: your Pixel ID constant variable.
  • Advanced matching: email, phone and external ID, each from its data layer variable. The template has a setting for whether the values you pass are already hashed or not. Choose the one that matches your data layer.
  • Product data: turn on Google Analytics E-commerce Data Layers. The template then reads the products from the GA4-style items in your data layer and sends them as content IDs, with quantity and price. Set Currency to your currency variable, and make sure Value is the real order total, never a fixed number.
  • Event ID: under De-duplication Configurations, add your event ID variable. The order ID works well for Purchase.
  • Trigger: purchase.

The other tags follow the same pattern:

  • ViewContent: trigger view_item. Send the product as the content ID, content_type product, value and currency.
  • AddToCart: trigger add_to_cart. Same details.
  • InitiateCheckout: trigger begin_checkout. Same details, with every product in the cart.

Give every event tag the same advanced matching fields and an event ID. You don't need them to make the pixel work, but you will need the event ID when you add the Events API.

Step 5: publish and test

Click Submit, name the version, for example "TikTok Pixel v1", and click Publish.

Then click Preview, enter your store's address and connect. Go through the store like a buyer: open a product, add it to the cart, start checkout and place a test order. In the Preview panel you should see the base code tag and each TikTok tag fire on its event: ViewContent, AddToCart, InitiateCheckout and Purchase.

Two more checks:

  • TikTok Pixel Helper. This Chrome extension shows each event on the page with what it carried. In the video it shows ViewContent and AddToCart with the content ID, content name, value, currency and advanced matching. Custom pixels run in Shopify's sandbox, so the extension may not show every event on the checkout pages. If it doesn't, rely on the next check.
  • TikTok Events Manager. Open your pixel and use Test events to watch events arrive while you repeat the journey. Click the Purchase event and check the value, currency, content IDs and event ID. This is the source of truth.

Next step: add the Events API

What you've built runs in the browser. Ad blockers, browser privacy rules and dropped connections still stop some events from reaching TikTok. The Events API sends the same events from a server.

When the same event comes from both the pixel and the Events API, TikTok counts it once only if both copies have the same event name and the same event ID (TikTok Business Help Center, event deduplication). That's why every tag in Step 4 has one.

Common mistakes

The TikTok app still sends to the same pixel. Two sources mean two copies of every purchase. Keep one.

Data layer code left in theme.liquid or Additional scripts. That's the old method from the video. It can't track the new checkout, and if it's still there next to a custom pixel, some events fire twice. Remove it.

The custom pixel was saved but not connected. It won't track anything until you click Connect.

The trigger name doesn't match the data layer. purchase and Purchase are different event names. If a tag never fires, compare the trigger with what the data layer pushes in Preview mode.

No base code tag, or it fires too late. The TikTok template needs the base code on the page first. Fire it on Initialization - All Pages.

A fixed value on Purchase. The value must come from the data layer, so each order sends its real total and currency.

No event ID. The pixel works without one, but when you add the Events API, TikTok can't pair the browser and server events.

Questions people ask

Can I install the TikTok Pixel on Shopify without the app?

Yes. That's what this setup does. Google Tag Manager runs as a custom pixel under Settings → Customer events, and your TikTok tags live in Google Tag Manager. No app and no theme code.

Should I use CompletePayment or Purchase?

Purchase, for any new setup. TikTok renamed CompletePayment to Purchase and still accepts the old name, so an existing CompletePayment tag doesn't need to change.

Can I still put the TikTok Pixel in theme.liquid?

For the storefront, it still loads there, but it can't reach the checkout or the Thank you page, which is where purchases happen. A custom pixel covers every page, so use that.

Does advanced matching send customer data in plain text?

You choose. The TikTok template has a setting for hashed or not-hashed values. If your data layer sends plain email and phone, tell the template so, and it handles them.

Do I need the Events API as well?

For most stores running TikTok ads, yes. The browser pixel misses some events. The Events API sends them from a server, and the event ID you added here stops them being counted twice.

Where KiteTrack fits

KiteTrack takes this setup the rest of the way. It runs your own tracking server on your store's subdomain and sends your Shopify events to TikTok through the Events API, next to the pixel, with one event ID so each sale counts once. The same server sends to Meta, Google Ads and GA4, customer details are hashed before they leave it, and your tracking is checked every 30 minutes, so a broken event becomes an alert. See how it works for TikTok on Shopify.

Not sure whether your TikTok Pixel is sending what it should? Start with the free Tracking Check. It looks at your site in about two minutes, no signup. If you'd rather talk it through, book a call with me.

Sources

Get tracking tips by email

Short, practical fixes for Meta, Google Ads and GA4, from Abir.

You’re in. First tip lands soon.

Abir Molla
Written by Abir Molla

Tracking specialist. He builds and runs KiteTrack, and explains tracking on YouTube.

Keep reading

Let your ads see every sale.

30-day money-back guarantee · free migration · cancel any time