TikTok Ads Cloud Mode Integration
4 minute read
RudderStack lets you send your event data to TikTok Ads via cloud mode.
Note that:
- This integration supports both Events 1.0 and Events 2.0 API for sending events to TikTok. RudderStack recommends using the Events 2.0 API to send your events as TikTok will sunset the Events 1.0 API by the second half of 2024.
- To send custom events to TikTok Ads using RudderStack Open Source, use
rudder-transformerv1.52.0 or later.
Find the open source transformer code for this destination in the GitHub repository.
Track
Use the track call to capture user events along with the associated properties.
A sample track call is shown below:
rudderanalytics.track("Order Completed", {
checkout_id: "12345",
order_id: "1234",
affiliation: "Apple Store",
total: 20,
revenue: 15.0,
shipping: 22,
tax: 1,
discount: 1.5,
coupon: "ImagePro",
currency: "USD",
contentType: "product",
products: [{
product_id: "123",
sku: "G-32",
name: "Monopoly",
price: 14,
quantity: 1,
category: "Games",
url: "https://www.website.com/product/path",
image_url: "https://www.website.com/product/path.jpg",
},
{
product_id: "345",
sku: "F-32",
name: "UNO",
price: 3.45,
quantity: 2,
category: "Games",
},
],
})Event mapping
This destination does not strictly adhere to the RudderStack Ecommerce Event Spec.
You can use the Event mapping settings in the dashboard to map your events to the below TikTok standard events:
List of supported TikTok standard events
Add Payment InfoAdd to CartAdd to WishlistApplication ApprovalClick ButtonComplete PaymentComplete RegistrationContactCustomize ProductDownloadFind LocationInitiate CheckoutLeadPlace an OrderPurchaseScheduleSearchSubmit ApplicationSubmit FormSubscribeStart TrialView Content
TikTok has recently updated the following standard events:
Submit Formis renamed toLead.Complete Paymentis renamed toPurchase.Although TikTok still supports the old events (
Submit FormandComplete Payment), RudderStack recommends using the new events (LeadandPurchase) to avoid any issues.
Note that RudderStack automatically maps the following standard ecommerce events to the corresponding TikTok standard events:
| RudderStack event | TikTok Ads event |
|---|---|
Product Added to Wishlist | Add to Wishlist |
Product Added | Add to Cart |
Checkout Started | Initiate Checkout |
Payment Info Entered | Add Payment Info |
Checkout Step Completed | Complete Payment |
Order Completed | Place an Order |
Property mapping
RudderStack maps the following optional event properties to the corresponding TikTok Ads fields:
| RudderStack property | TikTok Ads property |
|---|---|
timestampRequired | event_time |
properties.eventIdproperties.event_idmessageId | event_id |
properties.limited_data_use | limited_data_use |
properties.contents | properties.contents |
properties.contentTypeproperties.content_type | properties.content_type |
properties.query | properties.search_string |
properties.shopIdproperties.shop_id | properties.shop_id |
properties.orderIdproperties.order_id | properties.order_id |
properties.currency | properties.currency |
properties.value | properties.value |
properties.description | properties.description |
properties.query | properties.query |
properties.ttclid | user.ttclid |
properties.ttpproperties.context.user.ttp | user.ttp |
properties.context.user.emailcontext.user.emailtraits.emailcontext.traits.emailproperties.email | user.email |
properties.context.user.phonetraits.phonecontext.traits.phoneproperties.phone | user.phone |
properties.citycontext.traits.citycontext.traits.address.city | user.city |
properties.countrycontext.traits.countrycontext.traits.address.country | user.country |
properties.statecontext.traits.address.statecontext.traits.state | user.state |
properties.att_status | user.att_status |
properties.appIdproperties.app_id | app.app_id |
properties.appNameproperties.app_name | app.app_name |
properties.appVersionproperties.app_version | app.app_version |
properties.callBack | ad.callback |
properties.campaignIdproperties.campaign_id | ad.campaign_id |
properties.adIdproperties.ad_id | ad.ad_id |
properties.creativeIdproperties.creative_id | ad.creative_id |
properties.isRetargetingproperties.is_retargeting | ad.is_retargeting |
properties.attributed | ad.attributed |
properties.attributionTypeproperties.attribution_type | ad.attribution_type |
properties.attributionProviderproperties.attribution_provider | ad.attribution_provider |
properties.leadIdproperties.lead_id | lead.lead_id |
properties.leadEventSourceproperties.lead_event_source | lead.lead_event_source |
properties.context.page.urlproperties.urlcontext.page.url | page.url |
properties.context.page.referrerproperties.referrercontext.page.referrer | page.referrer |
context.locale | user.locale |
context.user.emailtraits.emailcontext.traits.email | user.email |
context.traits.phonetraits.phone | user.phone |
context.iprequest_ip | user.ip |
context.userAgent | user.user_agent |
context.traits.citycontext.traits.address.city | user.city |
context.traits.countrycontext.traits.address.country | user.country |
context.traits.address.statecontext.traits.state | user.state |
context.device.advertisingId | user.idfa |
context.device.id | user.idfv |
context.device.advertisingId | user.gaid |
context.app.namespace | app.app_id |
context.app.name | app.app_name |
context.app.version | app.app_version |
firstName | user.first_name |
lastName | user.last_name |
zipcode | user.zip_code |
Note that the properties.ttclid to user.ttclid mapping corresponds to the properties.clickId to context.ad.callback mapping in Events 1.0 API.
TikTok will sunset the Events 1.0 API by the second half of 2024. RudderStack recommends using the Events 2.0 API to send your events.
| RudderStack property | TikTok Ads property |
|---|---|
properties.eventId | event_id |
timestamp | timestamp |
properties.testEventCode | test_event_code |
properties.contents | properties.contents |
properties.currency | properties.currency |
properties.clickId | context.ad.callback |
properties.value | properties.value |
properties.description | properties.description |
properties.query | properties.query |
properties.context.ad or context.ad | context.ad |
properties.context.page or context.page | context.page |
properties.context.user | context.user |
context.ip | context.ip |
context.userAgent | context.user_agent |
From externalId tiktokExternalId | user.external_id |
For custom events, RudderStack maps only the standard fields supported by TikTok Ads and drops all other fields in the event. See TikTok Ads standard fields documentation for more information.
For TikTok event matching,
context.userAgentmust contain the original end-user browser user agent string.Do not pass a server, proxy, CDN, or other infrastructure user agent, for example,
Amazon CloudFront, because these values are not useful for event matching.
FAQ
I see a 40002 response code with ‘No permission to operate pixel code’ error message, what can I do?
This error code is related to the authentication of your TikTok account. For more information, refer to the TikTok documentation.