Business Help Center
Create an Ad
English
Define Tracking Rules
After creating a series of events, the next step is to define the rules for each event. This helps our auction system determine if a user took the action you desired on your website.

But before we dive into how to do that, let's stop for a second and take some time to understand the following terms. Believe us, this will help you tremendously along your path to defining rules.

Event: An event is an action taken by a user on your website (like adding to cart). The action can come from a TikTok ad (paid), or can come organically (unpaid). Learn more about how to create events.

Tracking behaviors (user): Tracking behaviors (user) refers to the exact type of user behavior you want to track on your website. For each event, we provide three types of behaviors to choose from:
  • Button click (referred to as Click Events): This behavior refers to clicking an element on a webpage. An element on your webpage can include clicking on a button (add to cart, submit a form), clicking on a link, clicking on a picture, or even clicking on a line of text.
  • Page browsing (referred to as Destination URL): This behavior refers to the loading of a specific webpage URL. For example, when a confirmation page loads after a purchase, or a thank you page loads after your lead generation.
  • Pop-up events: This behavior refers to the display of a pop-up window. For example, when a thank you pop-up gets displayed after a user submits a form successfully.

Interactive mode: Interactive mode refers to how the user interacts with the webpage.

  • Element selection mode: Clicking on an element in this mode will NOT lead you to the next page. Rather, it is used to visually choose the page element when tracking the button click behavior (click events).
  • Webpage preview mode: Clicking on an element in this mode will lead to the next page similar to viewing it online. This helps you navigate to the webpage destination for when tracking the page browsing behavior (destination URL).

Triggering rule: Triggering rule refers to how an event will be triggered. Once the user completes the behavior, the rule you set is satisfied, and the corresponding event will be triggered. When tracking user behavior for clicking a button, the trigger rule will be the CSS selector code for the button. When tracking user behavior for completing a payment, the trigger rule will be the payment completion URL.

What's the process for defining rules?

After creating your events, you will be taken to a page to define rules for each event.

1. For each event, you can track by Click Events, Destination URL, or Pop-up events. 

  1. Define specific triggering rules for each event. See below for more details on how to define each rule.
  2. After completing the triggering rules for all events, click "Complete".

How to define triggering rules for each event?

Defining Click Events

There are two methods for defining Click Events:
  1. Entering your website url and selecting the element on the preview page.
  1. Manually adding CSS selector of the element.

Select element on the preview page:

  1. Enter your landing page URL (including http / https) in the Website URL text box at the top of the page, and click "Update". Your page will load on the left side.
  2. Click on the desired element (button) on your webpage. 
  1. A pop-up will appear to confirm. Click "Save".
  1. Your selection will automatically appear as a rule.

Note: For Click Events, the default setting for the preview page is Element selection mode, but you can also switch to Webpage preview mode.

Screen Shot 2020-05-11 at 7.02.26 PM.png


Manually add CSS selector code:

  1. Click "Add Rule".
  1. Enter your CSS selector code.
    1. Contact your website developer to provide the CSS selector code for your selected element and enter it in the blank. If entered incorrectly, the system will display an error message.
  1. Click "Save".

    Screen Shot 2020-05-11 at 6.56.44 PM.png
Note:
  • We recommend installing the TikTok Pixel Helper first before defining rules.
  • Event tracking will only come into effect after installing the Pixel code on the website.
  • You can use both visually choosing elements and manually adding elements together when defining rules. Visually added elements can be deleted by clicking on "Cancel" if you choose the wrong one incautiously.
  • For each rule, only one element can be added. You can click on "Add rule" to set additional rules for multiple elements.
  • When creating more than one rule, the rules are based on an "OR" statement. For example, when Rule 1 OR Rule 2 is satisfied, the event will be triggered.
  • Data disclosure at rule level is currently not available.

Defining Destination URL:

For defining Destination URL, you can manually enter the keywords from your url.
  1. Click "Add Rule".
  1. Select from page url, page hostname, or page path. See below for more details on which one to select.
  1. Choose from conditions: "contains", "equals", and "does not contain".
  1. Fill in the keywords from the URL you want to track. You can also use the preview page to navigate your website to the correct page.
      • Select "page url
      • Select "contains"
      • Enter "thank_you"
  1. Click "Save".

Note: For Destination URL, the default setting for the preview page is Webpage preview mode and you can not switch to Element selection mode.

Screen Shot 2020-05-11 at 6.58.53 PM.png

Page URL vs page hostname vs page path?

image.png
Page url: refers to the entire page URL. For example, https://www.sample.com/id123456/thank_you in the above image.
  • We recommend you select "page url" > "contains" for most business scenarios. 
    • For example, if you want to track when a confirmation page loads after a purchase, the url may be https://www.sample.com/id123456/thank_you. By setting "page url"> "contains">"thank_you", this will match the entire link of all the pages where the pixel is installed. When a user loads a page that contains "thank_you" in the URL, the event will be triggered and reported.
Page hostname: refers to the part of a URL following "http(s)://". For example, www.sample.com in the above image.
  • We recommend only using 1 pixel per website.

Page path: refers to the part of a URL following the page hostname. For example, "/id123456/thank_you" in the above image.
  • For most situations, page url is your best choice. However, there are situation where you need to choose "page path".
  • For example, if you want to track when a confirmation page loads after a purchase, yet your page hostname and your path are identical, https://www.thank_you.com/ididid/thank_you. In this case "thank_you" is not only included in the page path, but also in the page hostname.
  • If you use "page url" "contains" "thank_you", it will match all the pages under "https://www.thank_you.com" with the pixel installed, which is not what you want. So in these unusual situations, you want to choose "page path">"contains">"thank_you".

Note:
  • We recommend installing the TikTok Pixel Helper first before defining rules.
  • Event tracking will only come into effect after installing the Pixel code on the website.
  • When creating more than one rule, the rules are based on an "OR" statement. For example, when Rule 1 OR Rule 2 is satisfied, the event will be triggered.
  • For each rule, only one keyword can be added. You can click on "Add rule" to set additional rules for multiple keywords.
  • Use "equals" with caution, especially using "page url">"equals" together. Use "equals" only when the destination URL must match identically for the event to be triggered. This is because "page url" refers to the entire link, and there could be some dynamic ID parameters contained in the link.
  • We recommend using the "page url">"contains" option for most scenarios, and the "page path">"contains" option for some special scenarios.

Defining Pop-up Events

There are two methods for defining Pop-up Events:

1. Entering your website url and selecting the element on the preview page.

2. Manually adding CSS selector of the element.

Select element on the preview page:

  1. Enter into the “Define Event” page.
  1. Enter the landing page URL and click "Update". 
  1. Choose Pop-up Events as tracking method.
  1. Choose "Webpage preview" mode on the left side.
  1. Navigate through the webpage to get the pop-up to display.
  1. Switch to "Element selection" mode on the left side.
  1. Click on the desired element (button) on your webpage.
  1. A pop-up will appear to confirm. Click "Save".
  1. Your selection will automatically appear as a rule.

Note: For Pop-up Events, the default setting for the preview page is Webpage preview mode, but you can also switch to Element selection mode.

image.png

Manually add CSS selector code:

  1. Enter into the “Define Event” page.
  1. Click "Add rule".
  1. Enter your CSS selector code.
    1. Contact your website developer to provide the CSS selector code for your selected element and enter it in the blank. If entered incorrectly, the system will display an error message.
  1. Click "Save".

image.png

Note:
  • We recommend installing the TikTok Pixel Helper first before defining rules.
  • Event tracking will only come into effect after installing the Pixel code on the website.
  • When creating more than one rule, the rules are based on an "OR" statement. For example, when Rule 1 OR Rule 2 is satisfied, the event will be triggered.

Congratulations, you have now completed defining your rules for each event! The hard part is over! Now, it's time for the fun stuff- creating your campaign and running your ads!