Logo
  • Getting Started
  • Brands
  • Partners
Help Center
Help Center
Utilizing Tiktok Ads

Utilizing Tiktok Ads

Getting started

New to SquaredanceNew to SquaredanceGuidesGuidesFAQsFAQs

Brands

Brand Quick StartBrand Quick StartCampaignsCampaignsPartnershipsPartnershipsBrand ReportingBrand ReportingManaging CreativesManaging CreativesBillingBilling

Partners

Partner Quick StartPartner Quick StartTracking & IntegrationsTracking & IntegrationsPartner ReportingPartner ReportingSubmitting CreativesSubmitting CreativesPayoutsPayoutsReferralsReferrals

Technical Docs

Tracking ChangelogTracking Changelog

Utilizing Tiktok ads

This tutorial requires knowledge of backend coding languages like PHP and web servers. Support with setting up a server and coding of S2S API endpoint will not be covered by the Squaredance support. We suggest hiring an expert if you are not comfortable proceeding with the this guide on your own.

To incorporate Tiktok ads tracking into SQD, you will first have to create a new pixel on Tiktok.

Creating a new pixel on you TikTok Ads Manager only takes a few simple steps:

1. When you have logged into your TikTok Ads Manager, please click on Assets -> Events on the top menu bar

image

2. Please click on Manage under Web Events

image

3. Please name the pixel, and select Events API. Proceed clicking Next.

image

4. Please select Manually Set UP Events API and click Next

image

5. Click Go to Settings

image

6. On the next page you will find your Pixel ID and can generate your access token that can later be used to integrate with our server. Click on the "Generate Access Token" button to create an access token. Share these two with the developer so that they can construct the payload that needs to be sent to the server.

image

The developer can create and test the events using the "Test Server Events" mode under the "Test Events" tab.

image

Step 2 - Creating a postback endpoint on your server

Important note!

This step requires knowledge of backend coding languages like PHP and web servers. Support with setting up a server and coding of S2S API endpoint will not be covered by the Squaredance support. We suggest hiring an expert if you are not comfortable proceeding with the this step on your own. Please share the following instructions about creating a postback endpoint with your developer.

  1. Create a server script that takes the value of ttclid query string parameter and creates a payload that is compatible with the TikTok API and delivers it to the TikTok server.
  2. Refer to TikTok's documentation on Marketing API for information on Access-Token, API endpoint, and example payload.
  3. It’s recommended that you use the value of the following query string parameters in your S2S postback script so that it’s compatible with the JS code in step 3.
Parameter
Description
ttclid
TikTok’s Click ID
event
Ecommerce Event Type

Your final application URL with the query string parameters and placeholder values should look like - https://yourdomain.com/tiktok?ttclid=[ttclid here]&event=[event name here]

Step 3 - Add your postback to the Squaredance platform

  1. Multi-funnel pixel template - Replace yourdomain.com/tiktok with your application URL.
  1. Purchase pixel template - Replace yourdomain.com/tiktok with your application URL.
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
var event = 'CompletePayment';
var pixel = document.createElement("img");
pixel.src = "https://yourdomain.com/tiktok?ttclid=" + urlParams.get('ttclid') + "&event=" + event;
</script>
  1. After replacing the placeholder application URL with your application URL in the multi-funnel pixel and purchase pixel. Go to the Squaredance partners platform and select a campaign. You can click on the add button to add new pixels.
  2. Add the multi-funnel pixel as shown in the screenshot below and click on save.
  3. image
  4. Add the purchase pixel as shown in the screenshot below and click on save.
  5. image

Now the partners platform will ping your server with the TikTok click ID and event name whenever a new user lands on the funnel.

Step 4 - Create campaigns and ads

  1. When setting up a new conversion campaign make sure you select a TikTok pixel id and an optimization event as shown in the screenshot below
  2. image
  3. Important - When creating ads make sure you use &ttclid=__CLICKID__ at the end of the ad links. If this parameter is added, TikTok ads will pass the click id to the funnel whenever a new user lands on it. To know more about TikTok’s click id please refer to TikTok's TTCLID Parameter Doc.

FAQs

How do TikTok's e-commerce events compare with the Squaredance events?

TikTok maintains its own set of E-Commerce events in order to track user engagement along a funnel. We've mapped the following TikTok events to corresponding Squaredance events.

TikTok Event
Squaredance Event
ViewContent
Engagement
ViewContent
Lead
ViewContent
ViewContent
AddToCart
AddToCart
InitiateCheckout
InitiateCheckout
AddPaymentInfo
AddPaymentInfo
CompletePayment
Purchase

Why is TikTok not passing the click id to the funnel?

If TikTok has enabled the TTCLID for your add account, it will start passing in the URL parameters for new users coming from live ads. If TTCLID is not passing for you, please refer to TTCLID Parameter Doc.

How to fire TikTok's pixel only from traffic originating from TikTok?

Please use the setting in the pixel area of the campaign and select the option to conditionally fire pixel based on sub ID values or values of c1, c2, c3.

@Squaredance
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
var events = {
 Engagement: "ViewContent",
 Lead: "ViewContent",
 ViewContent:"ViewContent",
 AddToCart:"AddToCart",
 InitiateCheckout: "InitiateCheckout",
 AddPaymentInfo: "AddPaymentInfo"
};
var event = events["xxeventxx"] || "ViewContent";
var pixel = document.createElement("img");
pixel.src = "https://yourdomain.com/tiktok?ttclid=" + urlParams.get('ttclid') + "&event=" + event;
</script>