UTM builder
X (Twitter) Ads UTM Builder
Build campaign-ready URLs with a macro toggle, clean encoding, and GA4-friendly naming. Keep consistency across teams and channels.
Build your tracking URL
We encode parameters and keep GA4-friendly naming. Macros live in the right column.
Keep it normalized: paid_social. Avoid free text like “boosted”.
Your URL
We always URL-encode parameters. Copy and drop into your ads manager.
Platform & macros
Switch platform and toggle macros.
Macros
Insert platform tokens into UTMs.
Macros & sample values
Click a macro to inject at your cursor in the focused field.
GA4-friendly defaults
- • Medium: paid_social
- • Source: twitter
- • Keep casing lowercase and snake_case for consistency.
- • Use `utm_content` for creative/macros; `utm_term` for keyword or audience.
Official Platform Documentation
Frequently Asked Questions
What are X Ads (Twitter Ads) tracking macros?
X Ads (formerly Twitter Ads) provides dynamic macros like {campaign_id}, {line_item_id}, and {creative_name} that automatically populate with campaign data when users click your promoted posts or ads. These ensure accurate attribution in GA4 for X traffic, helping you understand which campaigns and creative variants drive engagement and conversions.
What is a "line item" in X Ads tracking?
In X Ads terminology, a "line item" is equivalent to an ad group in other platforms—it sits between the campaign and individual creatives. {line_item_id} captures this level of the campaign hierarchy, allowing you to track which targeting groups or audience segments perform best in GA4. Including {line_item_id} in utm_content helps you optimize audience targeting.
How does {device} help optimize X campaigns?
{device} captures whether the user clicked on mobile or desktop. X (Twitter) usage skews heavily mobile, but conversion behavior often differs by device. By passing {device} to utm_term, you can analyze in GA4 which device types drive better conversion rates and optimize your X Ads bidding and creative strategy by device.
Should I use twclid or manual UTM tracking with X Ads?
X Ads automatically appends twclid (Twitter Click ID) for conversion tracking via the X Pixel. Similar to other platform click IDs, mixing twclid with manual utm_source/medium parameters can cause attribution conflicts in GA4. Best practice: Use twclid for X Pixel conversion tracking, and add manual UTM parameters with macros for proper GA4 channel grouping (utm_source=twitter, utm_medium=cpc or paidsocial).
What's the recommended UTM structure for X (Twitter) Ads?
For X paid social: utm_source=twitter, utm_medium=cpc (or paidsocial), utm_campaign={campaign_id}, utm_content={line_item_id}_{creative_name}, utm_term={device}. This ensures GA4 classifies traffic as Paid Social and provides visibility into which campaigns, line items, creatives, and device types drive conversions from X Ads.
What happens if I don't use X Ads macros?
Without macros, you must manually create unique UTM parameters for every X campaign, line item, and creative—time-consuming and error-prone for brands running multiple promoted posts. You'll lose the ability to identify which specific tweets, audiences, or device types drive conversions in GA4, making it impossible to optimize X Ads spend based on actual performance data. Macros automate this entirely.
Get Your Free Audit in 60 Seconds
Connect GA4, run the scan, and see exactly where tracking is leaking budget. No credit card required.
Trusted by growth teams and agencies to keep attribution clean.