tiktok integration with ga4
Hi there,
I’ve implemented TT base code into GTM as well as our events and have also included the following url parameter (?
utm_source
=tiktok&utm_medium
=cpc&utm_campaign
=_CAMPAIGN_NAME_&utm_term
=_AID_NAME_&utm_content
=_CID_NAME_&ttadid=_CID_) in our tiktok ads. We’re currently running reach and traffic campaigns but they don’t seem to be tracking in our source/medium report. They’ve been live for about 4 days now with no activity being tracked. Does anyone have a solution for this?
The short answer is:
Your issue is very common with TikTok’s dynamic URL parameters as the macros like
often fail to resolve into the actual campaign values in the URL, especially when redirects or browser restrictions intervene, which means GA4 just records the literal variable name or no source/medium at all.CAMPAIGN_NAME
To fix the UTM tracking, you should first try to replace the dynamic TikTok macros with static, non-macro values for the required parameters like
, or look for a simple typo, an incorrect parameter separator (must be utm_campaign
&
), or a server-side redirect that strips the parameters.
The robust, long-term solution is to implement the TikTok Events API (Conversions API) via a server-side setup using Google Tag Manager and a server-side hosting solution like Stape or Google Cloud Platform to send your conversion events directly to TikTok’s servers, which bypasses unreliable browser tracking for conversions and improves ad attribution.
The long answer is:
The first step is to thoroughly check for a fundamental issue that could be stripping your UTM parameters before GA4 records them.
Check for common issues like server-side redirects or JavaScript redirects on your landing page that are not preserving the query parameters, as this is a frequent cause of tracking loss and could be happening even though your link looks correct.
Also, double-check that you are using the correct URL structure with a single ?
to start the query parameters and an ampersand & to separate each parameter-value pair, and ensure all your UTM values are lowercase, as GA4 is case-sensitive and inconsistency can lead to fragmentation.
While the URL parameters you listed are mostly standard, the TikTok-specific parameters like &ttadid=CID
won’t automatically populate the standard GA4 fields and should be accompanied by the required
and utm_source
parameters, which you’ve included.utm_medium
If the dynamic macros are not resolving, you’ll see the raw macro name in your reports, so consider using hardcoded, static values for
and utm_campaign
as a test to see if static parameters work correctly, which would confirm the issue is with the dynamic macros.utm_content
While fixing the UTM tagging may resolve your source/medium traffic reports, a better and more resilient solution for conversion tracking and ad optimization is moving to server-side tracking using the TikTok Conversions API (Events API) in conjunction with Google Tag Manager and a solution like Stape or Google Cloud Platform.
This setup is highly effective because it moves your conversion event tracking from the user’s browser (client-side) to a secure web server (server-side).
Client-side tracking is increasingly unreliable due to ad blockers, Intelligent Tracking Prevention (ITP) in browsers like Safari, and strict privacy settings that block or limit third-party cookies and tracking scripts.
By setting up a server-side GTM container, hosted affordably with a service like Stape, you can use your web GTM container to send a stream of data to your server container via a Google Analytics 4 tag or a dedicated Data Client.
Then, your server GTM uses a TikTok Events API tag to securely forward conversion events like
, Purchase
, Lead
CompletePayment
, or even custom Standard Events directly to TikTok’s servers using a first-party context.
This method offers superior data quality, higher match rates for conversions, and better ad attribution for TikTok’s algorithm because you have more control over the data sent, including securely hashing and sending user data like email and phone number, which is crucial for matching the conversion back to the original TikTok ad click.
This approach, which is inexpensive using a solution like Stape for hosting, helps you future-proof your tracking against browser limitations and ensures you are sending the most complete and accurate conversion data back to TikTok for campaign optimization, leading to better Return on Ad Spend (ROAS).