TikTok Ads & Events API Setup
Configure TikTok Pixel and TikTok Events API in a unified tracking layout. Recover lost storefront actions and map purchase events directly from your Shopify server to TikTok's optimization algorithms.
Deduplication and Server-Side Recovery
Standard browser-side tracking scripts are often blocked by ad-blockers, cookie limitations, or network latency.
TrakIt resolves this by running a dual-tracking setup. Browser pixels record front-end clicks and catalog views, while TrakIt's server listens to secure Shopify back-end webhooks. The moment an order completes, TrakIt fires a direct server-side payload to TikTok.
To prevent double-counting of these events, TrakIt appends a matching event_id token to both browser triggers and server-side webhook payloads. TikTok automatically links matching IDs and dedupes them.
Step-by-Step Configuration Guide
Step A: Retrieve Your TikTok Pixel ID
- Log into your TikTok Ads Manager account.
- Navigate to the Assets tab → select Events from the dropdown.
- Click Manage under the *Web Events* section.
- Copy your active Pixel ID (formatted as an alphanumeric string, e.g.
ABC1234567890XYZ). - Paste it into TrakIt's Pixel ID field under the Configuration panel.
Step B: Retrieve Your Events API Access Token
- Inside TikTok Events Manager, select your pixel data source and click the Settings tab.
- Scroll down to the **Events API** section.
- Click the Generate Access Token button.
- Copy the generated access token key string.
- Paste it into the Api Access Token field inside TrakIt.
- Click Save.
Configuration Lock Behavior
Note that in TrakIt, the **Save** buttons under the *Event Selection* and *Settings* cards are disabled initially. They will unlock for editing once you have successfully entered and saved your Pixel ID and Access Token in the *Configuration* card.
Step C: Google Tag Manager (GTM) Container Sync
To load TikTok Pixel web triggers onto storefront pages, the tracking tag configuration must be synced with your Google Tag Manager (GTM) workspace:
Automatic GTM Import (Recommended)
If your Google Account is connected to TrakIt, all TikTok Ads events and tag configurations will be imported automatically into your GTM container via GTM API. There is no need to download or upload container files manually.
If your Google account is not connected, you must download the container JSON file from TrakIt's right-hand sidebar and import it manually:
How to import manually into GTM:
- Open your Google Tag Manager workspace.
- Go to Admin → Import Container.
- Upload the downloaded container file.
- Choose Merge.
- Click Confirm to integrate the tag configurations.
* Note: Since we automatically import the tags into the container when the Google account is connected, there is no need to manually import it.
Offered Events Mapping
TrakIt supports the following standard events for TikTok Ads. Check the boxes to activate Web or Server reporting for each event:
| Event Name | Trigger Description | Server | Web |
|---|---|---|---|
| ViewContent | Customer opens a product page. | - | ✔ |
| Search | Customer executes a store search query. | - | ✔ |
| AddToCart | Customer adds a product to their shopping cart. | ✔ | ✔ |
| InitiateCheckout | Customer clicks to begin Shopify checkout. | ✔ | ✔ |
| AddPaymentInfo | Customer enters payment card details. | - | ✔ |
| Purchase | Customer completes payment and finishes the checkout. | ✔ | ✔ |
Granular Settings & Parameters
The **Settings** panel at the bottom of the left column provides customization options for your parameter data feeds:
Order IdentifierDefine the order ID sent to TikTok. Select between **Transaction ID** (recommended), **Order Number**, or **Order Name**.
Product IdentifierAlign item catalog matches with your TikTok Business Center catalog. Choose **Product ID**, **Variant ID**, or **SKU**.
Exclude Sales ChannelsFilter out specific non-storefront orders from triggering Events API payloads. Select channels like Recharge, Point of Sale (POS), or Shopify Draft Orders.
Conversion Value AdjustmentsSet checkable toggles to exclude taxes or shipping costs, or deduct discount values from order total amounts.
Testing Server Events via Test Code
TikTok Ads settings in TrakIt include a dedicated **Test Code** input field under the Settings panel. This lets you route and verify Events API payloads inside TikTok's debug console in real-time:
- Log into TikTok Ads Manager and navigate to the Events Manager screen.
- Select your Web Pixel source, and click on the Test Events tab at the top.
- Copy the generated alphanumeric test code.
- Paste the code into TrakIt's Test Code text field in the settings card.
- Click Save Settings.
- Perform testing behaviors on your Shopify storefront (e.g. click a product, add to cart, or start checkout).
- Verify inside TikTok's *Test Events* console that server-side payloads are immediately received, displaying Events API as the connection method.
Remove Test Code After Testing
Always clear the Test Code field and click **Save Settings** once you have confirmed event delivery. Leaving a test code active in production will route merchant conversions to the test log stream.
Unlinking & Tag Deletion
To remove the integration:
- Click Disconnect in the Disconnect panel.
- TrakIt automatically triggers an API removal run on your Tag Manager workspace to clean up TikTok Ads tags and parameters. (If you are in manual setup mode, you will need to delete these variables inside GTM yourself).