Passer au contenu principal

TikTok Pixel Integration

CrowdChange supports TikTok Pixel browser tracking and optional TikTok Events API purchase tracking. Once connected, your TikTok Pixel receives page, AddToCart, and CompletePayment events. If a TikTok Events API access token is configured, CrowdChange also sends completed payments from the server.

Setup

  1. Go to Admin -> Layout Settings -> Meta & Analytics
  2. Scroll to the TikTok pixel section
  3. Enter your TikTok Pixel ID, for example CXXXXXXXXXXXXXXX
  4. Optional: enter your TikTok Events API access token
  5. Click Save
The browser Pixel snippet is automatically injected into every page once the Pixel ID is saved. Events API tokens are stored as write-only encrypted values; leave the token field blank to keep an existing token.

Tracked Events

Page

Fired automatically on page load and virtual page navigation.
ttq.page();

AddToCart

Fired when an item is added to the checkout cart.
ParameterTypeDescription
currencystringISO 4217 currency code, for example USD, CAD
valuenumberTotal value of the item payload
contentsobject[]TikTok content payloads
Example payload
{
  "currency": "CAD",
  "value": 50,
  "contents": [
    {
      "content_id": "registration",
      "content_name": "Registration",
      "content_category": "registration",
      "price": 50,
      "quantity": 1
    }
  ]
}

CompletePayment

Fired when a donor successfully completes a transaction.
ParameterTypeDescription
currencystringISO 4217 currency code
valuenumberTotal transaction amount
order_idstringCrowdChange transaction ID
event_idstringtransaction_<transaction_id> dedupe identifier
contentsobject[]TikTok content payloads
Example payload
{
  "currency": "CAD",
  "value": 100,
  "order_id": "1000",
  "event_id": "transaction_1000",
  "contents": [
    {
      "content_id": "donation",
      "content_name": "Donation",
      "content_category": "donation",
      "price": 100,
      "quantity": 1
    }
  ]
}

Server-Side Payment Tracking

When both a TikTok Pixel ID and TikTok Events API access token are configured, CrowdChange sends a server-side CompletePayment event.
FieldDescription
pixel_codeTikTok Pixel ID
eventCompletePayment
event_idtransaction_<transaction_id>
timestampEvent timestamp
currencyTransaction currency
valueTransaction total
order_idCrowdChange transaction ID
contentsPurchased content IDs and quantities
callbackCaptured ttclid value when available
ttpTikTok _ttp browser cookie when available
emailSHA-256 hashed donor email when available
external_idSHA-256 hashed CrowdChange user ID when available
ipRequest IP address
user_agentRequest user agent
Ad-network failures are logged and do not interrupt the donor checkout flow.

Click ID Attribution (ttclid)

When a visitor arrives via a TikTok ad, TikTok may append ttclid to the URL. CrowdChange captures this value in the browser session and passes it to server-side Events API calls as callback. CrowdChange also forwards the _ttp cookie when available.

Verifying Your Setup

After saving your Pixel ID:
  1. Visit any page on your platform and confirm TikTok Pixel loads from https://analytics.tiktok.com/i18n/pixel/events.js
  2. Navigate between pages and confirm page events fire
  3. Add an item to the cart and confirm AddToCart fires
  4. Complete a test transaction and confirm CompletePayment fires with the expected value, currency, and event_id
If you configured Events API, verify the server-side event in TikTok Events Manager.

Additional Information

See TikTok Pixel docs and TikTok Events API docs for further information.