Google Tag Manager

TikTok Pixel in Google Tag Manager (and the Snap Pixel Too)

Install the TikTok and Snap pixels with their official GTM templates, map GA4 events to each platform’s names, set the right dedup key and phone format, and test before publishing.

Cover: Two pixels, one dataLayer. one dataLayer purchase push splitting into a TikTok Purchase tag and a Snap PURCHASE tag, each labelled with its own dedup key name.

Most TikTok pixel guides stop at "paste the base code on All Pages". The work that decides whether TikTok and Snap optimize well comes after: which event each action maps to, which field carries the dedup ID, and whether the hashed phone is in the format that platform can match. Both platforms are covered here because a team that runs one usually runs both.

Install both templates

TikTok Pixel

TikTok gives two routes, and its help says your container permissions must include Publish, Approve, Edit and Read. The recommended route runs from TikTok Events Manager, which installs the tags into your container for you. The manual route is the TikTok Pixel template by TikTok from the Community Template Gallery. Its fields cover the Pixel ID, an Event Name (a dropdown that also accepts a variable), advanced matching for email, phone and external ID, product properties that can be read from a GA4 ecommerce dataLayer, and an Event ID under De-duplication Configurations.

Snap Pixel

Snap’s template is Snap Pixel by Snapchat. One tag type covers the base event and conversions: you set the Pixel ID and an Event Type (PAGE_VIEW, VIEW_CONTENT, ADD_CART, START_CHECKOUT, ADD_BILLING, PURCHASE, SIGN_UP and others), plus fields for email and phone (raw or hashed), price, currency, item IDs, number of items, transaction ID and Client Deduplication ID. It also has an Enable Console Logging (Debug Mode) option for testing in Preview. For Snap’s own tools, see Snapchat Pixel setup.

Event mapping table

Name events once in the dataLayer, GA4 style, and map them here. This is a starting point; confirm each name against the platform’s current list and your server setup.

Copy this

GA4 event to TikTok and Snap

 TikTok eventSnap eventParameters to map
page viewBase pixel page eventPAGE_VIEWNone beyond the base tag
view_itemViewContentVIEW_CONTENTTikTok content_ids, value, currency; Snap item_ids, price, currency
add_to_cartAddToCartADD_CARTSame as above, plus quantity or number of items
begin_checkoutInitiateCheckoutSTART_CHECKOUTvalue or price, currency, item IDs
add_payment_infoAddPaymentInfoADD_BILLINGvalue or price, currency
purchasePurchasePURCHASEvalue or price, currency, item IDs, transaction ID, event ID
generate_leadSubmitFormSIGN_UP or a custom eventevent ID; a value if you assign one
sign_upCompleteRegistrationSIGN_UPevent ID
searchSearchSEARCHTikTok search_string; Snap search string

Two choices need a written decision in your tracking plan. First, TikTok’s purchase name: its current standard events page lists Purchase, while the GTM template’s dropdown still offers CompletePayment and PlaceAnOrder. Second, Snap leads: with no lead event, teams send SIGN_UP or a custom event, sometimes PURCHASE when campaigns already optimize on it. Whatever you choose, the server must send the same name.

Dedup keys and phone formats

Keep next to the build

Same idea, different field names

 Browser fieldServer fieldWindowPhone before hashing
MetaeventID (Event ID in the template)event_id48 hours, same event nameDigits with country code, no plus
TikTokevent_id (Event ID in the template)event_id48 hours, identical event and event_idE.164 with the plus sign
Snapclient_dedup_id (Client Deduplication ID)event_id48 hours; purchases also match transaction_id to order_id for up to 30 daysDigits with country code; no plus, no leading 00 or 0

So a number written +971 50 123 4567 is hashed as 9715XXXXXXXX for Meta and Snap, and as +9715XXXXXXXX for TikTok (X marks the remaining digits). Hash the wrong form and the match silently fails. The cleanest fix is upstream: ask the developer to push both hashes into the dataLayer, for example sha256_phone and sha256_phone_e164, and let each tag read its own. Email is the same everywhere: trim, lowercase, then SHA-256.

TikTok keeps the first event it receives within the window. Snap matches the Pixel’s client_dedup_id to the server’s event_id and says the two values should be identical. Generate the ID once per event in the dataLayer push and map it to both templates.

Test before you publish

  1. GTM Preview. Walk the conversion path and confirm each TikTok and Snap tag fired once, on the right trigger, with the event ID and value filled.
  2. TikTok. The TikTok Pixel Helper Chrome extension shows what the pixel sent from the page. Then check the event in TikTok Events Manager, including its test events view.
  3. Snap. Turn on the template’s console logging in Preview to see the data each tag sends, then check the pixel’s activity in Snapchat Events Manager. Turn logging off afterwards.
  4. Server leg. Send one test event from the server with the same event ID and confirm both platforms show one event, not two.

Where this goes wrong

  • Old and new Snap pixels on one page. In my experience, a Snap track call reaches every Snap pixel initialized on the page, so an old tag’s events land on the new pixel too. Audit for extra base tags before reading the new pixel’s numbers.
  • Different names on browser and server. SIGN_UP in the browser and PURCHASE on the server will never deduplicate.
  • Base pixel fires before identity is ready. If advanced matching values arrive with a page-data push, fire the base tags on that push, not on All Pages.
  • One phone hash for everyone. TikTok’s match quality drops when it receives a hash of a number without the plus sign, and vice versa for Meta and Snap.
  • Leads mapped by habit. Map leads to whatever your campaigns optimize on, then keep it stable; changing the event later resets learning.

Meta’s side of the same setup is in Meta Pixel in Google Tag Manager. The purchase push all three platforms read from is in GTM ecommerce tracking.

Do it faster with Whathead

With Whathead’s Google Tag Manager MCP, Claude can list every TikTok and Snap tag in a container with its event name, trigger and dedup field, find duplicate base tags, and add missing event tags in a workspace. Whathead is our product.

  • “List every TikTok and Snap tag in GTM-XXXXXXX with the event it sends, its trigger, and which variable fills Event ID or Client Deduplication ID. Flag any page with two base tags for the same platform.”
  • “Create TikTok Purchase and Snap PURCHASE tags on the purchase Custom Event, both reading {{DLV - event_id}} for dedup. Don’t publish.”

Before anything changes, Claude asks you to approve each GTM write. There is no dry-run preview for GTM, so the workspace is your draft and you test in Preview before publishing. For server events, Whathead’s server-side tracking sends TikTok Events API and Snapchat Conversions API events with the event ID, and is in private pilot.

TikTok pixel in Google Tag Manager: common questions

Can I install the TikTok pixel with Google Tag Manager?

Yes. Install it from TikTok Events Manager, or add the TikTok Pixel template by TikTok from the Community Template Gallery. TikTok’s help says you need Publish, Approve, Edit and Read permissions on the container.

Is there an official Snap Pixel template for GTM?

Yes. Snap Pixel by Snapchat is in the Community Template Gallery. It covers the base event and conversions, including a Client Deduplication ID field.

Which TikTok event should I use for purchases?

TikTok’s current standard events page lists Purchase. The GTM template still offers CompletePayment and PlaceAnOrder, so choose deliberately and send the same name from the server.

How do I test the TikTok pixel?

Use GTM Preview, then the TikTok Pixel Helper Chrome extension, then the event view in TikTok Events Manager.

Why is my TikTok or Snap match quality low?

Often the phone is hashed in the wrong format, or the pixel fires before email and phone are available. TikTok expects E.164 with a plus sign; Snap expects digits only.

Sources

Written by Ahmed Shahin, founder of Whathead. Last reviewed 19 November 2026.