Repository navigation
feat: capture GA4 campaign parameters and Google click IDs used on iOS and Display & Video 360 - #223
Merged
Merged
Conversation
This was referenced Oct 14, 2026
…parameters # Conflicts: # test/utm.test.ts
…parameters # Conflicts: # src/runtime/utm.ts
Member
Author
|
Review notes before merging:
|
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.
The module read five UTM parameters plus
gclidandgad_source. Google documents more:utm_id,utm_source_platform,utm_creative_format, andutm_marketing_tactic, although its reports don't show the last two yet (URL builders).gbraidorwbraidalongside or instead ofgclidfor some iOS traffic (iOS measurement, click conversion uploads). It also addsgad_campaignidalongsidegad_source(traffic-source dimensions), and Display & Video 360 and Campaign Manager 360 tag clicks withdclid.None of these were stored, so attribution payloads lacked them. With
captureWithoutCampaign: false, a visit tagged only with them was skipped, and in the same session a newgbraidclick or a differentutm_idwas deduplicated as a repeat of the previous entry.src/runtime/parameters.tsnow holds both lists, and everything else derives from them: theUTMParamsandGCLIDParamstypes, reading the query, deciding whether a visit is a campaign, and deduplication. Adding a parameter later is one edit. First and last touch already considered any nonempty field, so they pick up the new ones without changes. The README lists the supported fields.UTMParamsandGCLIDParamsstay interfaces. Each one extends the type derived from its list, so apps can still add fields through declaration merging.@typescript-eslint/no-empty-object-typeflags an interface that only extends another type, so the ESLint config allows that single-extends form. Entries stored by earlier versions remain valid because every field stays optional.This changes which visits count as campaigns. A visit tagged only with one of the new parameters, such as a
dclidclick or agbraidvisit, used to be a direct visit. Now it is a campaign touch, can becomelastTouch, and adds new keys togetAttribution()payloads. A backend that validates attribution against only the original keys needs to accept the new ones, so the release notes should call this out.The 12 new cases in
test/utm.test.tscover each new parameter on its own, reading all of them, and deduplication on a changedutm_idor a newgbraid; all of them failed before the change. The package consumer fixture checks that the published types include the new fields, keep them typed as strings, and can still be augmented. The augmentation check failed withDuplicate identifier 'UTMParams'while the types were aliases.Validation:
pnpm lint --max-warnings 0,pnpm format:check,pnpm test:types,pnpm dev:build,pnpm test(96 tests),pnpm test:package, andpnpm test:compatibilityagainst Nuxt 4.6.1 and Nuxt 3.21.11 pass.