Skip to main content

TikTok Pixel (Events API)

Send quiz events to TikTok Ads so you can build audiences of quiz takers, optimise campaigns on quiz leads, and measure quiz-driven sales. ShopperQuiz sends events through TikTok's Events API from its servers, so ad blockers and iOS privacy settings don't stop them, and purchases are reported with real revenue.

Available on: Starter plan and above · Platforms: Shopify and WooCommerce (identical)

Events sent to TikTok​

EventWhenType
SQ_QuizStartThe shopper starts the quizCustom
LeadThe shopper enters their emailStandard
SQ_QuestionAnsweredEach question is answered (includes question and answers)Custom
SQ_QuizCompleteThe results page is reachedCustom
ViewContentRecommendations are shownStandard
SQ_AddToCart or AddToCartRecommended products are added to the cart from the resultsSee below
SQ_InitiateCheckout or InitiateCheckoutThe shopper clicks checkout in the quizSee below
SQ_Purchase or PurchaseThe order is paid (sent from your store's order notification, with revenue, order ID and the order's real items)See below

All events carry sq_quiz_id and sq_quiz_name. Products are identified by your store's product IDs, with content_type: product_group, so they match catalogs synced by the TikTok app for Shopify.

Cart, checkout and purchase event names​

OptionNamesUse when
Quiz-specific (default)SQ_AddToCart, SQ_InitiateCheckout, SQ_PurchaseYour store already sends TikTok its own purchase events, for example through the TikTok app for Shopify. Avoids counting conversions twice
StandardAddToCart, InitiateCheckout, PurchaseNo other TikTok pixel tracks your purchases, and you want to optimise campaigns on these events
Optimising campaigns

TikTok can only optimise campaigns on standard events. Quiz-specific events work for reporting and audiences. You can always optimise on quiz leads, because Lead is standard.

Match quality​

ShopperQuiz sends, hashed where TikTok requires it:

  • the shopper's email (SHA-256 hashed)
  • a hashed shopper ID
  • the shopper's IP address and browser user agent
  • TikTok's _ttp browser cookie and ttclid ad-click ID, when available (for example, if the shopper arrived from a TikTok ad)

The IP address and user agent are deleted from ShopperQuiz after 30 days.

Connect TikTok​

You need your Pixel Code and an Events API access token.

  1. In TikTok Ads Manager, go to Tools → Events → Web events and open your pixel. Copy the Pixel Code shown under the pixel name. It's about 20 capital letters and numbers, for example C4ABCDEFGH1234567890.
  2. On the pixel, open Settings → Events API → Generate Access Token. Copy the token.
  3. In ShopperQuiz, go to Integrations → TikTok Pixel → Connect TikTok, paste both values and save. ShopperQuiz checks them with TikTok before saving.
Unused tokens expire

TikTok automatically expires access tokens that aren't used for about 90 days. If ShopperQuiz reports an invalid or expired token, generate a new one and save it in the drawer.

What gets tracked (settings)​

ToggleEvents
Funnel eventsSQ_QuizStart, SQ_QuizComplete
Per-question eventsSQ_QuestionAnswered
LeadsLead
Commerce & revenueViewContent, add to cart, checkout and purchase

Sync per quiz: turn TikTok off for individual quizzes. All quizzes are tracked by default.

Test your setup​

  1. In TikTok Events Manager, open your pixel → Test events and copy the test event code.
  2. Paste it in the drawer under Test events.
  3. Send test event sends one SQ_ConnectionTest event, which appears in Test events within seconds.
  4. Test a full quiz run turns on test mode for 2 hours. Every event from your next quiz runs, including the purchase, shows in Test events.

Unlike Meta, TikTok excludes test events from your real data. They appear only on the Test events page. Turn test mode off (or let it expire) before you rely on reports.

Use it in TikTok​

  • Audiences: Assets → Audiences → Create → Custom audience → Website traffic with event SQ_QuizComplete or Lead.
  • Lead campaigns: optimise on the Lead event.
  • Sales campaigns: choose Standard commerce names to optimise on Purchase (only if no other TikTok pixel reports your purchases).

Disconnect​

Integrations → TikTok Pixel → Manage → Disconnect TikTok stops sending events and deletes the saved access token. Data already in TikTok is kept.

Troubleshooting​

ProblemFix
Can't save (invalid token)Generate a new token on the same pixel. Make sure the Pixel Code, not the pixel name, was pasted
Test events show, but reports are emptyTurn off test mode; TikTok doesn't count test events
No InitiateCheckoutIt only fires from the checkout button inside the quiz
No purchaseThe order must be linked to the quiz and paid (see Shopify / WooCommerce)
Card says "Needs attention"TikTok rejected recent events, usually an expired or revoked token. Generate a new one and save it

Was this page helpful?