Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

UTM parameters & dynamic tracking for ChatGPT Ads

How to structure UTM parameters and OpenAI's dynamic ad tokens for ChatGPT Ads attribution

The main ChatGPT Ads guide covers browser and server conversion tracking. This page covers campaign-click attribution: sending clean, joinable URL data into GA4, the client's CRM, and their data warehouse.

The two-layer model

Don't put OpenAI's object IDs into utm_source or utm_medium — that fragments GA4's channel grouping into one row per campaign. Instead, use two separate layers:

  • Marketing taxonomy (utm_source, utm_medium, utm_campaign, ...) — stable, human-readable values you set once per campaign. This is what GA4 channel reporting groups on.

  • Technical join keys (oai_* parameters, built from OpenAI's dynamic tokens) — the platform's own object IDs, used to join spend/click data back to sessions, leads and orders in the CRM or warehouse. Names are editable in Ads Manager after launch, IDs are not, so use IDs as the historical join key wherever possible.

OpenAI's dynamic tokens

When the "Landing page query parameters" field is available for a campaign, these four tokens can be added to it and are resolved into the destination URL at click time:

Token
Represents
Example value
Recommended target parameter

{campaign_id}

Top-level campaign object

cmpn_101

utm_id (and/or oai_campaign_id)

{ad_group_id}

Ad group within the campaign

adgrp_301

oai_ad_group_id — not utm_term

{ad_id}

Individual ad

ad_501

utm_content (and/or oai_ad_id)

{ad_account_id}

OpenAI Ads account

adacct_123

oai_account_id

There is no {product_id} token for product-feed campaigns. Add the SKU or item ID as a static parameter on each product's landing URL instead, and confirm during QA that it survives when the same URL is reused across products.

For a standard campaign where the query-parameter field is available, append this to the landing page query template in Ads Manager:

utm_source=chatgpt&utm_medium=paid_ai&utm_campaign=<static-campaign-slug>&utm_id={campaign_id}&utm_content={ad_id}&utm_source_platform=openai_ads&oai_account_id={ad_account_id}&oai_campaign_id={campaign_id}&oai_ad_group_id={ad_group_id}&oai_ad_id={ad_id}

Which, once OpenAI resolves the tokens on an eligible click, arrives on the landing page as something like:

Keep utm_source, utm_medium, utm_campaign and utm_source_platform static — type them out per campaign, don't template them. Only the object IDs go through the dynamic tokens; they're tedious to type correctly by hand and that's exactly where a join key needs to be exact.

Use one lowercase naming convention throughout (chatgpt, not ChatGPT or Chatgpt). Mixed casing is the most common cause of a campaign showing up as multiple rows in GA4's channel report.

oppref: leave it alone

You'll see an oppref parameter appended automatically to eligible landing URLs, on top of any configured UTMs. This is OpenAI's click reference for Conversions API attribution. It is unrelated to UTMs and matches the click ID stored in the first-party __oppref cookie. Never manually set, overwrite, or strip oppref in a redirect. Doing so breaks OpenAI-side attribution.

Support varies by how the campaign is built

Campaign type
Confidence the dynamic tokens resolve
What to do

Standard Ads Manager campaign (CPM/CPC/oCPC)

Medium — works when the "Landing page query parameters" field is visible in that account

Use the dynamic tokens; verify with a controlled test click

Product-feed campaigns

Low — no product token exists

Add SKU/item ID statically per product URL

Bulk CSV creation

Low — no documented query-template column

Use fully static UTMs in the landing URL, or set the query-parameter field manually after upload

Public Advertiser API

Low — schema has no landing-query-suffix field

Build static query strings from the object IDs already in the API response

MMP links (AppsFlyer, Adjust, ...)

Depends on the MMP

Never replace an MMP link with a plain URL — only use that partner's supported custom parameters, and confirm the resolved values survive the redirect chain

Capturing the parameters in GTM and GA4

On the client's web container:

  1. Make sure the GA4 configuration tag (or your GA4 event tags) picks up utm_id, utm_content and the other standard UTMs the way it already does for other paid channels — no extra work needed there.

  2. For the oai_* parameters, they won't populate GA4's built-in traffic-source dimensions automatically. Read them from the URL with a Data Layer or URL variable, send them as an event parameter on your key events, and register matching GA4 custom dimensions if the client wants to report on them (e.g. for creative-level analysis by oai_ad_id).

  3. If the client has lead forms, parse the landing URL on first page load and write the values into hidden form fields so they land in the CRM: original source/medium, the static campaign slug, oai_campaign_id/utm_id, oai_ad_group_id, oai_ad_id/utm_content, oai_account_id, oppref, and the full raw landing URL plus a timestamp (useful for forensic QA later).

For GA4 channel reporting, set up a custom channel group once per client:

Troubleshooting

Symptom
Likely cause
Fix

Landing URL contains the literal text {campaign_id}

This account/campaign type doesn't support token resolution

Confirm the token picker is available in that exact account; fall back to static values

Only the static UTMs show up, the oai_*/dynamic ones don't

Field wasn't saved, or the campaign type doesn't support it

Re-check the saved field value; test with a fresh eligible click

Duplicate query keys in the final URL

The same key is set both in the ad's destination URL and in the campaign's query-parameter field

Give each parameter a single owner — either the ad URL or the campaign suffix, never both

One ChatGPT Ads campaign shows as several rows in GA4

Inconsistent casing or a campaign-name change (mutable) used as the join key

Normalize source/medium casing; use a stable static slug instead of the live campaign name

Ads Manager clicks noticeably exceed GA4 sessions

Expected gap — page-load failures, consent, redirects, ad blockers and attribution windows all differ from a GA4 session

Compare like-for-like dates/timezones before treating it as a tracking bug

OpenAI-side conversions are missing despite GA4 showing them

oppref was stripped somewhere, or the Pixel/Conversions API event IDs don't match

Confirm oppref survives every redirect; check that client-side and server-side events share the same event ID (see deduplication guide)

QA checklist before launch

Last updated

Was this helpful?