Sync Shopper Activities and Monitor Web Events

You can send shopper activities to TikTok, track conversions, and build custom audiences for optimized product discovery. Two options are available. Complete the TikTok for Business integration and sync your product catalog before you begin.

Option 1

Events API Based tracking queues the events by storing them inside custom objects. Events call the TikTok batch API to push or send them to TikTik. The ViewContent event is the only real-time API call to TikTok.
  1. To make sure you have the latest code changes for int_tiktok cartridge, pull the latest code version from GitHub.
  2. Upload the code to your sandbox or instance. If you haven’t completed the TikTok for Business integration and synced your product catalog, complete those processes before you continue.
  3. Import the metadata for the server-side event tracking. The files are in the data-pixel folder.
  4. Add the int_tiktok_pixel cartridge to your cartridge path. The cartridge tracks the following events:
    • View Content (Product Show)
    • AddToCart (add item to carat)
    • InitiateCheckout (begin checkout)
    • CompletePayment (place order)

    Cartridges and Effective Cartridge Path

  5. Enable or disable events tracked by the tiktok-settings custom object.
    1. In Business Manager, select Merchant Tools > Custom Objects > Custom Objects Editor.
    2. From the Object Type dropdown, select SocialChannels.
    3. From the object list, select the tiktok-settings object.
    4. Click Edit Selected. The tiktok-settings reflect how the TikTok for Business app links to TikTok. The Tracking section lists the toggles that you can enable or disable.

    Business Manager Manage Custom Objects page

  6. (Optional) Set the View Content event tracking. The default setting is None and the event isn’t queued. Setting the option to either Real Time or Queue Events, isn’t recommended for high traffic sites or during a flash sale. If you set the Queue Event option, run or schedule the TikTok-WebEvents-Push job more frequently. The job pushes the events to TikTok and clears the custom objects.
    Note: When you deselect the Enable Events API Based Tracking all events are disabled.

    TikTok tracking settings

    View Content event Tracking dropdown

  7. When the setup is complete, use the Test Event Function to verify your event setup.

    TikTok Ads Manager

Option 2

Embed the TikTok pixel into your site to send shopper activities into TikTok. For detailed steps, see TikTok documentation.
  • int_tiktok exposes a hook app.template.htmlHead. You can use the hook to inject the TikTok pixel directly into an SFRA storefront that manually installs the pixel to a site. To enable the pixel, add the following code snippet in htmlhead.isml.
    <isprint value="${dw.system.HookMgr.callHook('app.template.htmlHead', 
                                'htmlHead', pdict) || ''}" encoding="off">
After you inject the TikTok pixel base code across the storefront, you can add event codes to track and report on specific user actions. You use both TikTok pixel base code and event scripts to successfully track and report conversions.
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.