> For the complete documentation index, see [llms.txt](https://docs.getpurpledot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getpurpledot.com/integrations/analytics/tiktok/connect.md). Agents can also search and read this documentation through its [MCP server](https://docs.getpurpledot.com/~gitbook/mcp).

# Connect TikTok

Connect TikTok to receive events from the Purple Dot checkout.

Background: [How analytics integrations work](https://docs.getpurpledot.com/integrations/analytics/how-analytics-integrations-work.md#checkout-events).

{% hint style="warning" %}
Purple Dot sends TikTok the sale when the shopper places the pre-order. When you release it, Purple Dot also creates an order in your e-commerce platform, and a connection that reads platform orders can record the sale again. After a test release, check that the new order doesn't duplicate the sale in TikTok. See [De-duplicating orders at release](https://docs.getpurpledot.com/understanding-purple-dot/pre-order-timing-and-your-reporting.md#de-duplicating-orders-at-release).
{% endhint %}

## Before you start

* [Set up TikTok storefront tracking](https://docs.getpurpledot.com/integrations/analytics/tiktok/set-up-storefront-tracking.md), or verify your existing tag or pixel.
* Your store sells pre-orders through the Purple Dot checkout.
* The [TikTok](https://apps.shopify.com/tiktok) app is installed in your Shopify store and connected to your TikTok Ads account.
* A **TikTok Pixel** is active on the storefront through that app, with browser events flowing in TikTok Events Manager.
* You have admin access to your TikTok Ads Manager and Events Manager.

## Steps

1. In TikTok Events Manager, open the pixel used on your storefront and go to **Settings** > **Events API**.
2. Generate an access token. Copy it straight away and store it securely.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-bb71fdaa18d365b58cf0ba07330f35bdf21d1f21%2Fanalytics-tiktok-setup-3.png?alt=media" alt="TikTok setup screen"><figcaption></figcaption></figure>
3. On the same pixel, open **Settings** (or the pixel overview) and copy the **Pixel ID**.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-0270e1e2ee888e3b1df5932f1c9b19e323310f91%2Fanalytics-tiktok-setup-4.png?alt=media" alt="TikTok setup screen"><figcaption></figcaption></figure>
4. Optional: open the **Test Events** tab and copy the **Test event code**. Keep the tab open.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-95f642ae90a9cead58b6e3216f09ce27e06346e5%2Fanalytics-tiktok-setup-5.png?alt=media" alt="TikTok setup screen"><figcaption></figcaption></figure>
5. In the Merchant Portal, go to **Settings** > **Integrations**.
6. Under **Analytics**, select **Connect** for **TikTok**.
7. Enter the **Access Token** and **Pixel ID** from steps 2 and 3. The Pixel ID must match the pixel connected in the TikTok Shopify app.
8. Optional: enter the **Test Event Code** from step 4, select **Test Connection**, and wait for **Credentials verified!**. Purple Dot sends a test event named `PurpleDotTestEvent`, which TikTok routes to the **Test Events** tab.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-f37d48324ae93c4d613ca88abf0f5a5ba7c8ad83%2Fanalytics-tiktok-setup-7.png?alt=media" alt="TikTok verification screen"><figcaption></figcaption></figure>
9. Select **Save**.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-02027c011b2d21f5b018b3ad8964433133ff927c%2Fanalytics-tiktok-setup-6.png?alt=media" alt="TikTok verification screen"><figcaption></figcaption></figure>

Once the connection is saved, Purple Dot sends events automatically. No other configuration is required in Purple Dot.

## Verify

1. Copy the **Test event code** from **TikTok Events Manager** > your pixel > **Test Events**.
2. Open any storefront page with the code in the URL, for example `https://your-store.com/products/example-product?tiktok_test_event_code=YOUR_TEST_CODE`.
3. Accept cookie consent, so the `_ttp` cookie is set.
4. Complete a test pre-order: add to cart, open checkout, enter payment details, and complete the order.
5. In **Test Events**, confirm the real checkout events appear: `AddToCart`, `InitiateCheckout`, `AddPaymentInfo`, and `Purchase`.

   <figure><img src="https://2758444809-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM5A7csYKEplvsuQqHenE%2Fuploads%2Fgit-blob-a3c5bc7122a820807dfff4ba8977918edef9ca64%2Fanalytics-tiktok-setup-8.png?alt=media" alt="TikTok verification screen"><figcaption></figcaption></figure>

Purple Dot keeps the test event code for the browser session, so it carries through to checkout. For that session, every TikTok event Purple Dot sends goes to **Test Events** instead of production reporting. To stop sending test events, close the browser tab or open a session without the parameter.

## Troubleshooting

* [My integration is not syncing](https://docs.getpurpledot.com/troubleshooting/orders-and-inventory/integration-is-not-syncing.md)
* [Get more help](https://docs.getpurpledot.com/troubleshooting/get-more-help.md)

## Related

* **Concept:** [Choosing a checkout method](https://docs.getpurpledot.com/understanding-purple-dot/choosing-a-checkout-method.md)
* **Do this:** [Track pre-order conversion](https://docs.getpurpledot.com/managing-pre-orders/reports-and-data/track-pre-order-conversion.md)
* **Look up:** [TikTok events and settings](https://docs.getpurpledot.com/integrations/analytics/tiktok/events-and-settings.md)
* **Fix it:** [My integration is not syncing](https://docs.getpurpledot.com/troubleshooting/orders-and-inventory/integration-is-not-syncing.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.getpurpledot.com/integrations/analytics/tiktok/connect.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
