Skip to content

Commit

Permalink
chore: fix gclid update on same session
Browse files Browse the repository at this point in the history
  • Loading branch information
JosueDiaz1722 committed Jan 24, 2025
1 parent e0f94fa commit 6959e45
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/utm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ export const isRepeatedEntry = (
const lastEntry = data.value?.[0];
const lastUtm = lastEntry?.utmParams;
const newUtm = currentEntry.utmParams;
const lastGCLID = lastEntry?.gclidParams;
const newGCLID = currentEntry.gclidParams;

return (
lastEntry &&
Expand All @@ -88,6 +90,8 @@ export const isRepeatedEntry = (
lastUtm.utm_medium === newUtm.utm_medium &&
lastUtm.utm_source === newUtm.utm_source &&
lastUtm.utm_term === newUtm.utm_term &&
lastEntry.sessionId === currentEntry.sessionId
lastEntry.sessionId === currentEntry.sessionId &&
lastGCLID?.gad_source === newGCLID?.gad_source &&
lastGCLID?.gclid === newGCLID?.gclid
);
};

0 comments on commit 6959e45

Please sign in to comment.