Template macros are placeholder tokens you drop into an ad template, usually a landing-page URL, that the advertising platform swaps for real values such as a campaign or ad ID at the moment the ad is served. They differ from static UTM parameters you type out by hand: the platform fills them in automatically for each impression, while a static value stays fixed across every click.
For a marketer running paid campaigns on ChatGPT Ads, macros decide whether you can trace a conversion back to the exact ad that produced it. Skip them and your reporting collapses into one undifferentiated bucket of AI traffic you cannot optimize.
A template macro is a single token, written in a syntax like {campaign_id}, that an ad platform recognizes inside a template field and resolves to live data when it delivers your ad.
Every macro has two parts: the literal placeholder you enter and the value the platform substitutes at delivery. The placeholder usually sits in the landing-page query string, though some platforms also expose macros for creative text and bidding. OpenAI supports four such macros in ChatGPT Ads landing-page query parameters as of 2026: {campaign_id}, {ad_group_id}, {ad_id}, and {ad_account_id}. If the platform does not recognize the exact token syntax, an unsupported or misspelled macro passes through as literal text and breaks the destination URL.
Macros sit alongside static UTM parameters and dynamic creative features in the same setup. Static parameters carry human-readable labels; macros carry machine-readable IDs that join cleanly against platform exports. AirOps helps teams track how AI search engines surface and cite their pages, so the paid IDs your macros capture can be read beside organic AI visibility in one place.
A macro stays inert until the platform delivers your ad, then resolves in a fixed sequence that turns a placeholder into real campaign data on the destination URL.
Place the token. Enter the macro, such as {campaign_id}, into the template field the platform supports, usually the landing-page query parameter box.
Save as text. The platform stores the macro literally, so the campaign holds the placeholder and no value yet exists.
Serve the ad. When your ad is delivered to a user, the platform reads the token and looks up the matching object ID for that exact impression.
Substitute the value. The platform replaces the token with the real ID at delivery time, so the visitor arrives with live data in the URL query string.
Capture downstream. Your site reads the resolved IDs and persists them to analytics and your CRM for attribution.
The resolved URL tells you which campaign, ad group, or ad drove a specific click, so you can tie spend to pipeline. It says nothing about the user or the conversation behind the ad; macros carry structural IDs only.
Whether you can prove paid AI campaigns drive revenue often comes down to whether your macros resolved correctly. Buying decisions about budget rest on clean attribution, and macros are the plumbing that makes it possible. Without them, you are deciding where to spend on a channel you cannot measure at the level that matters, which pushes money toward guesses and away from the ad groups that actually close deals.
Attribution granularity: Macros let you join a click to the exact ad group that produced it, so you fund what converts instead of the whole channel.
Consistent reporting: Because the platform fills IDs automatically, every click carries the same structured data, which keeps GA4, your CRM, and your warehouse in agreement.
A concrete failure mode: Hardcode IDs by hand and a single typo sends every click to the wrong campaign record, or strips the value entirely and triggers a missing-click-information warning that quietly breaks attribution for the whole flight.
SEO managers use template macros to attribute AI-search paid clicks to the exact campaign, so organic and paid visibility can be compared on the same dashboard.
Growth marketers use template macros to pass campaign and ad IDs into their CRM, connecting closed revenue back to the ad group that sourced it.
Demand gen leads use template macros to keep UTM reporting consistent across every ChatGPT Ads flight without hand-editing URLs for each new campaign.
The platform resolves a macro to its real value at the moment the ad is served to a user instead of when you save the campaign, which is why the same placeholder can yield a different ID on every impression it fills.
Each platform recognizes one exact macro format, such as single braces wrapping {campaign_id}, and a token that is unsupported or misspelled passes through unresolved, landing on the page as literal text that corrupts the destination URL.
Most macros populate landing-page query parameters, though some platforms extend the idea to creative fields such as headlines or descriptions, so confirm which template slots actually accept macros in your account before you build reporting on them.
Trace every paid AI click back to the campaign, ad group, and ad that generated it.
Join platform IDs cleanly against ChatGPT Ads CSV exports without manual lookups.
Keep GA4, CRM, and warehouse records consistent across an entire campaign.
Resolve supported ID macros in ChatGPT Ads automatically at delivery time.
Cut the manual URL editing that introduces typos and broken tracking links.
Spot broken attribution fast through the platform's missing-click-information warning.
Confirm the exact macro syntax in your account before launch, because an unsupported token lands on the page as broken text.
Keep source, medium, and campaign-name UTMs static and typed out, so human-readable labels stay stable across renames.
Reserve macros for the IDs that are hard to type and valuable for joins, since those are where automatic substitution pays off.
Test one live click before scaling spend, because the only proof a macro resolved is the real ID arriving on your landing page.
Persist resolved IDs to your CRM as well as analytics, so closed revenue can be traced to the ad that sourced it.
Monitor the platform's missing-click-information warning, because it is the fastest signal that a redirect is stripping your parameter.
Avoid hardcoding IDs by hand to save setup time. Competent marketers do this when a macro field looks fiddly, then discover weeks later that every click logged the same stale ID, and the attribution they trusted was wrong for the entire flight.
AirOps: Tracks how AI search engines cite your pages, so the paid IDs captured by your macros sit beside organic AI visibility in one view.
OpenAI Ads Manager: The native console where you enter ChatGPT Ads landing-page macros and confirm the supported token syntax before launch.
Google Analytics 4: Reads the resolved IDs arriving in your URL query string and ties each paid AI click to acquisition and conversion reports.
Audit your account. Open your ChatGPT Ads campaign settings this week and check whether the landing-page query parameter field exposes macro tokens. No budget approval needed.
Map your IDs. Decide which object IDs you need for reporting, typically campaign and ad, and write the macro string that carries them into your destination URL.
Build the URL. Combine static UTMs for readable labels with the ID macros in a single query string, keeping source, medium, and campaign name typed out by hand.
Test a live click. Launch a small flight, click your own ad, and confirm the real IDs land on the page and in your analytics before you raise the budget.
Wire up attribution. Persist the resolved IDs into your CRM and warehouse so closed revenue maps back to the ad group that drove it, and watch event-quality reports for any missing-click-information warnings.
Template macros are placeholder tokens an ad platform swaps for real values at delivery time.
You add them to a template slot, usually the landing-page query string, and the platform resolves them per impression.
The main constraint is syntax: only the exact tokens a platform supports will resolve, and the rest break the URL.
The main risk is silent failure, where a stripped or mistyped macro corrupts attribution for an entire campaign.
The payoff is granular attribution that ties paid AI spend to the specific ad group that generated pipeline.
Template macros and static UTM parameters do different jobs in the same URL. A static UTM is a fixed label you type once, such as utm_source=chatgpt, and it reads the same on every click. A template macro is a token like {campaign_id} that the platform replaces with a live ID at the moment it serves the ad, so its value changes from click to click. Use static UTMs for the human-readable context your team scans in reports: source, medium, and campaign name. Use macros for the machine-readable IDs that are tedious to type and valuable for deterministic joins against platform exports. The two are complementary, and most reliable setups carry both on the same destination URL: static labels for people, resolved IDs for systems. Mixing them gives you reporting that a human can read and a warehouse can join without guesswork.
Template macros resolve at delivery time, meaning the platform substitutes the real value when it serves your ad to a user, and never at the earlier point when you save the campaign. If you inspect the campaign in the Ads Manager, the field still shows the literal token, which is expected and does not mean anything is broken. The proof of resolution is on the destination side: when a user clicks, the URL they land on carries the real campaign or ad ID in place of the token. There is no fixed schedule to this; resolution happens on every qualifying impression or click for as long as the flight runs. That is why you test by clicking a live ad and reading the landing-page URL, instead of checking the setup screen. If the token still appears in the landed URL, the macro did not resolve and your attribution for those clicks is lost.
Template macros vary by design, because each one resolves to data specific to the impression that triggered it. A macro like {ad_id} returns the ID of whichever ad actually served, and across a campaign with several ads that value changes every time a different ad wins the placement. The same applies to ad group and campaign IDs when a user interacts with different parts of your account structure. This variation is the entire point: it is what lets you separate performance by ad group instead of lumping all AI traffic together. If a macro returned the same value on every click, it would carry no more information than a static label. So variation signals the macro is working. A value that never changes, by contrast, usually means the token failed to resolve and is sitting on the URL as literal text, which is the case worth investigating.
No, you cannot add to the set of macros a platform supports; you can only use the tokens it already recognizes. In ChatGPT Ads, OpenAI defines which macros exist and how they are written, and an invented or borrowed token, such as Google Ads syntax, will not resolve. What you can control is how you use the supported set: which IDs you pass, where you place them in the query string, and how you combine them with static UTMs. You also control whether you keep a static fallback ready in case the macro field is not available in a given account, since this behavior can be beta and account-gated. So the honest answer is that the menu is fixed by the platform, and your influence lies in how well you deploy what is on it. Confirm the current supported list in your own account before building reporting on any token.
A correctly working template macro setup is one where a real click produces real IDs on the landing page and in your downstream tools. A good benchmark is simple: click a live ad, read the destination URL, and confirm the token has been replaced by an actual numeric ID. Then check that the same ID appears in your analytics and CRM records for that session. In a healthy setup, the platform's event-quality reports show no missing-click-information warnings, which are the signal that a parameter was stripped on the way to your site. You should also see campaign and ad-level rows in your reporting that you can join back to spend, with no undifferentiated bucket of unattributed AI traffic. If every click maps to a specific ad group and closed revenue can be traced to it, the setup is doing its job. Anything less means a token, a redirect, or a join is failing somewhere.