Skip to content

fix(cache): strip the tracking params that were still fragmenting the key - #534

Merged
JonasJesus42 merged 1 commit into
mainfrom
fix/tracking-params-cache-key
Sep 8, 2026
Merged

fix(cache): strip the tracking params that were still fragmenting the key#534
JonasJesus42 merged 1 commit into
mainfrom
fix/tracking-params-cache-key

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Found by running parity cache-gap
for real against a production worker.

UTM_PARAMS predates GA4 and the current Google Ads click ids, so a large share
of paid traffic still mints its own edge cache entry on arrival — every one of
those landings pays a full cold render.

Evidence

Probed against routes whose bare URL was confirmed warm in the same instant
(paired measurement, so colo drift cannot be mistaken for a key leak):

param result already on the list?
utm_source, gclid, srsltid HIT 100% yes
gad_source, gbraid, wbraid MISS 3/3 no
_gl, igshid, mkt_tok MISS 3/3 no

Deterministic, on every route probed.

What's added

  • GA4 campaign paramsutm_id, utm_source_platform, utm_creative_format,
    utm_marketing_tactic. Only the five classic utm_* were covered.
  • Google Adsgad_source, gad_campaignid, gbraid, wbraid. gbraid and
    wbraid are what Google sends instead of gclid on privacy-restricted traffic
    (iOS/Safari), and gad_source rides along on essentially every Google Ads click.
    Between them that is a large slice of paid landings arriving cold.
  • _gl — the GA cross-domain linker. Sites already strip this by hand in client
    code, which is the tell that it turns up in real URLs.
  • igshid (Instagram), epik (Pinterest), mkt_tok (Marketo), yclid (Yandex).

Why this is safe

The risk of a strip list is stripping something functional — that serves one
listing under another's key, which is worse than a miss. Every param added here is
attribution-only: none is read by a loader, and none changes what the page
resolves to.

The tests assert both directions: the new params are stripped, and page,
order, map, PS, filter.*, skuId, q still are not.

Note skuId is deliberately absent. It fragments the key and that is correct —
verified on a real PDP that the rendered HTML differs by SKU (preload image,
og:image, og:url, and the robots meta all change). Stripping it to improve a
hit rate would serve the wrong variant.

Tests

packages/blocks: 1639 passing, tsc --noEmit clean, biome clean.

🤖 Generated with Claude Code


Summary by cubic

Strips additional tracking parameters from the edge cache key so paid traffic hits the warm cache instead of paying a full cold render. The old list only covered the five classic utm_* params and gclid; GA4 campaign params and Google Ads click ids like gad_source, gbraid, and wbraid still fragmented the key, measured at 3/3 misses on a production storefront.

What's added

  • GA4 campaign params (utm_id, utm_source_platform, utm_creative_format, utm_marketing_tactic).
  • Google Ads (gad_source, gad_campaignid, gbraid, wbraid), _gl, igshid, epik, mkt_tok, and yclid.
  • Tests assert the new params are stripped and functional params (page, order, map, PS, filter.*, skuId, q) are not.

Written for commit d38955b. Summary will update on new commits.

Review in cubic

… key

UTM_PARAMS predates GA4 and the current Google Ads click ids, so a large share of
paid traffic still minted its own edge cache entry on arrival.

Measured on a production storefront with `parity cache-gap`, against routes whose
bare URL was confirmed warm in the same instant: each param below MISSED on 3/3
routes, deterministically, while every param already on the list HIT at 100%.

Added:

- GA4 campaign params (`utm_id`, `utm_source_platform`, `utm_creative_format`,
  `utm_marketing_tactic`) -- only the five classic `utm_*` were covered.
- Google Ads (`gad_source`, `gad_campaignid`, `gbraid`, `wbraid`). `gbraid` and
  `wbraid` are what Google sends instead of `gclid` on privacy-restricted
  traffic, and `gad_source` rides along on essentially every Google Ads click,
  so between them they cover a large slice of paid landings.
- `_gl`, the GA cross-domain linker. Sites already strip this by hand in client
  code, which is the tell that it turns up in real URLs.
- `igshid` (Instagram), `epik` (Pinterest), `mkt_tok` (Marketo), `yclid` (Yandex).

Tests assert both directions: the new params are stripped, and functional params
(`page`, `order`, `map`, `PS`, `filter.*`, `skuId`, `q`) still are not -- dropping
one of those would serve one listing under another's key, which is worse than a
miss.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JonasJesus42
JonasJesus42 requested a review from a team September 8, 2026 18:15
@JonasJesus42
JonasJesus42 merged commit 3d8dc36 into main Sep 8, 2026
1 check passed
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 7.62.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant