← Back to Help Center

The problem this solves

A fully tagged URL carries eight or more parameters: source, medium, campaign, content, term, and whatever custom parameters your stack needs. That has three costs:

The alternative: the URL carries one stable ID, and the full parameter set lives in Trakr, resolved server-side when the click arrives.

Step 1: configure the Campaign ID

The Campaign ID is GA4's native utm_id parameter, and it has its own tab in the Syntax Builder. Two ways to fill it:

The Auto ID field card in the Syntax Builder: field type set to Auto ID (generated), with the explainer panel and an example ID
The Campaign ID tab: one field, type Auto ID (generated). That is the whole setup.
The builder wizard's Campaign ID step showing a generated read-only ID with the Auto ID badge
In the builder, the ID renders read-only with a fresh value for every link.

The one design rule: the ID must identify a single link, not a whole campaign. The Auto ID field satisfies this automatically. Composed IDs need a channel-level field in the structure.

Step 2: shorten the URL with the Lean profile

By default Trakr emits every parameter into the URL (the Full profile). To carry only the ID, open the Syntax Builder's Global Settings and switch URL Output from Full to Lean. A Lean URL looks like this:

https://example.com/summer?utm_id=k7f3a2cq&mycrmparameter=dach_launch_awareness
Global Settings in the Syntax Builder with URL Output set to Lean and the server-side GTM warning visible
Global Settings: URL Output switched to Lean, with the sGTM warning Trakr shows before you commit.

Two things to know:

Switch to Lean only after your server-side lookup is live. Without enrichment, GA4 receives hits with no source or medium and reports the traffic as direct. Trakr shows this warning on the setting and flags a Lean configuration whose Campaign ID structure is empty.

Step 3: resolve the ID server-side

When a click arrives, your server-side GTM container reads utm_id from the incoming hit and asks the Trakr API for the rest:

GET /v1/links?campaign_id=k7f3a2cq&per_page=1
Authorization: Bearer trakr_live_...

The response carries everything Trakr knows about that link: source, medium, campaign, content, custom parameters, and the predicted GA4 channel. From there, two common destinations:

The Live Preview with the LEAN URL badge: full parameter breakdowns above, a URL carrying only utm_id and the kept CRM parameter below
The Live Preview in Lean mode: every value still resolves (including the reference mirroring the ID into the CRM parameter), while the final URL carries just the ID.

Two habits for anything in the tracking path: cache lookups for about 5 minutes in your sGTM template (responses send cache headers and ETags), and fail open, meaning if the API is unreachable, send the hit with the ID you have rather than dropping it. API keys, endpoints, the response schema, and rate limits are documented on the API page.

What your team's workflow looks like

  1. Marketing builds campaign links in Trakr, exactly as before. The configuration mints the ID automatically.
  2. Ads, emails, and posts ship with short URLs carrying only the ID (plus kept custom parameters).
  3. Clicks arrive, sGTM resolves the ID via the API, GA4 and your database receive full, governed campaign data.
  4. Need to understand a link months later? Paste its ID into the API or find it in your Trakr history: the full context is there.

Common questions

Do I need the API to use Campaign IDs?

No. A Campaign ID is useful on its own: GA4 collects utm_id natively, and a stable ID lets you join GA4 data with your ad platforms or BI tooling. The API becomes necessary the moment you want Lean URLs, because something server-side has to resolve the ID back into source, medium, and the rest.

What happens to my campaign data when I switch to Lean URLs?

Nothing is lost. Trakr builds and stores every value exactly as before: source, medium, campaign, content, custom parameters, and the predicted GA4 channel all land in your history and are served by the API. Lean only changes what the public URL carries.

Can competitors still read my campaign taxonomy from my URLs?

With Lean URLs, no. The URL carries an opaque ID like k7f3a2cq plus any custom parameters you chose to keep. Your naming convention, funnel stages, and audience segments stay inside Trakr, visible only to your team and your server-side lookup.

What if I enable Lean URLs without server-side GTM?

GA4 would receive hits with no source or medium, and your traffic would report as direct. Lean is safe only when your sGTM lookup is live. Trakr warns you when you switch the setting and flags a Lean configuration whose Campaign ID structure is empty.

Should I use the Auto ID field or compose my own IDs?

Auto ID is the zero-discipline option: Trakr generates a unique 8-character ID for every link, including per row in bulk generation, so every lookup is exact. Compose your own (for example campaign plus channel) when you want IDs humans can read. Either way the ID must identify a single link, because one campaign usually has one link per channel.

Open the App, free, no signup →