fix(cache): strip the tracking params that were still fragmenting the key - #534
Merged
Conversation
… 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>
|
🎉 This PR is included in version 7.62.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by running
parity cache-gapfor real against a production worker.
UTM_PARAMSpredates GA4 and the current Google Ads click ids, so a large shareof 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):
utm_source,gclid,srsltidgad_source,gbraid,wbraid_gl,igshid,mkt_tokDeterministic, on every route probed.
What's added
utm_id,utm_source_platform,utm_creative_format,utm_marketing_tactic. Only the five classicutm_*were covered.gad_source,gad_campaignid,gbraid,wbraid.gbraidandwbraidare what Google sends instead ofgclidon privacy-restricted traffic(iOS/Safari), and
gad_sourcerides 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 clientcode, 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,qstill are not.Note
skuIdis 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 ahit rate would serve the wrong variant.
Tests
packages/blocks: 1639 passing,tsc --noEmitclean, 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 andgclid; GA4 campaign params and Google Ads click ids likegad_source,gbraid, andwbraidstill fragmented the key, measured at 3/3 misses on a production storefront.What's added
utm_id,utm_source_platform,utm_creative_format,utm_marketing_tactic).gad_source,gad_campaignid,gbraid,wbraid),_gl,igshid,epik,mkt_tok, andyclid.page,order,map,PS,filter.*,skuId,q) are not.Written for commit d38955b. Summary will update on new commits.