Skip to main content

Set up TikTok Pixel with Google Tag Manager (GTM)

TikTok Pixel helps you track visits to your platform and events such as purchases, so you can measure the results of your TikTok ads. This article shows how to install it with Google Tag Manager (GTM), after you connect GTM to your platform.

Ways to install TikTok Pixel with GTM​

You can install TikTok Pixel in one of these two ways:

  • Recommended way: install it from TikTok Events Manager with the direct GTM connection.
  • Manual way: add the TikTok Pixel code by hand in GTM with a Custom HTML Tag.

Requirements​

Before you start, make sure you have:

  • Basic knowledge of GTM ideas, such as Tags, Triggers and Variables.
  • An active Google Tag Manager account connected to your platform.
  • A Web Container in GTM, with full permissions (publish, edit, approve, read).
  • A TikTok Pixel (new, or one you created before).
  1. Sign in to TikTok Events Manager from TikTok Business Center.

  2. Go to Data Sources, then choose the pixel you want to connect.

  3. Click Settings.

  4. In the Partner Platform section, choose Choose Partner.

  5. Choose Google Tag Manager, then click Next.

    The TikTok window to choose an integration partner, with Google Tag Manager selected

  6. Choose Client-side Tagging, then click Get Started.

    The window to choose a data connection method, with Client-side tagging selected

  7. Sign in with the Google account that is linked to GTM.

  8. If you are creating a new Pixel, enter its name.

  9. Choose each of these:

    • The GTM account.
    • The Container.
    • The Workspace.
    tip

    If the Container does not show, create it in GTM, then refresh the page.

    The Choose container page with the Account, Container and Workspace fields

  10. Choose how to set up events:

    • TikTok Event Builder (recommended): set up and track events (such as Purchase and Add to Cart) without changing any code.
    • GTM Data Layer API: good if your site sends custom data to GTM through the dataLayer.

    The Choose method page with the recommended Event Builder option

  11. Review the suggested changes to your GTM account to make sure they are correct.

  12. Click Publish.

  13. Refresh your platform page to apply the changes.

Method 2: install by hand in Google Tag Manager (GTM)​

  1. In Google Tag Manager, go to Tags, then click New.

    The Tags page in Google Tag Manager and the New button

  2. Choose Custom HTML Tag.

    The list of tag types in GTM with the Custom HTML option

  3. Copy the pixel base code from TikTok Events Manager, and paste it in the code field.

  4. Add a Trigger (you usually choose All Pages to track all visits to your platform).

    A Custom HTML tag with the TikTok code and an All Pages trigger

  5. Click Save, then Publish.