From 8ad80ca5c215177578a02eb0a97a6de9e4b4c857 Mon Sep 17 00:00:00 2001 From: Prince Date: Wed, 27 Nov 2024 14:46:54 +0400 Subject: [PATCH] chore: fix fetching --- public/scripts/cookie/v1.0.1.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/scripts/cookie/v1.0.1.js b/public/scripts/cookie/v1.0.1.js index 26cc37ddb8110..fbe297916f276 100644 --- a/public/scripts/cookie/v1.0.1.js +++ b/public/scripts/cookie/v1.0.1.js @@ -217,11 +217,11 @@ const shouldOverwrite = (new_utm_data, current_utm_data) => { /* end handling date first contact */ /* start handling gclid */ - const gclid = searchParams.has("gclid") - const gclid_url = searchParams.has("gclid_url") - const final_gclid = gclid || gclid_url - - if (final_gclid) { + const gclid = searchParams.get("gclid"); + const gclid_url = searchParams.get("gclid_url"); + const final_gclid = gclid || gclid_url || ""; + + if (!!final_gclid) { eraseCookie("gclid"); document.cookie = `gclid=${final_gclid};domain=${getDomain()}; path=/; SameSite=None; Secure;`; }