Skip to content

Commit

Permalink
chore: added gclid_url tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-deriv committed Nov 27, 2024
1 parent d85f506 commit a52c194
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions public/scripts/cookie/v1.0.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,13 @@ const shouldOverwrite = (new_utm_data, current_utm_data) => {
/* end handling date first contact */

/* start handling gclid */
if (searchParams.has("gclid")) {
const gclid = searchParams.has("gclid")
const gclid_url = searchParams.has("gclid_url")
const final_gclid = gclid || gclid_url

if (final_gclid) {
eraseCookie("gclid");
document.cookie = `gclid=${searchParams.get(
"gclid"
)};domain=${getDomain()}; path=/; SameSite=None; Secure;`;
document.cookie = `gclid=${final_gclid};domain=${getDomain()}; path=/; SameSite=None; Secure;`;
}
/* end handling gclid */
})();

0 comments on commit a52c194

Please sign in to comment.