Skip to content

Commit 99492da

Browse files
committed
Deprecated dclid support
1 parent aa5aed4 commit 99492da

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/script/src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
(function () {
22
const CLICK_ID = 'dub_id';
3-
const OLD_CLICK_ID = 'dclid';
43
const COOKIE_EXPIRES = 90 * 24 * 60 * 60 * 1000; // 90 days
54
const HOSTNAME = window.location.hostname;
65

@@ -108,14 +107,13 @@
108107
function checkCookieAndSet(clickId) {
109108
const { cookieOptions, attributionModel } = getOptions(script);
110109

111-
const cookie = getCookie(CLICK_ID) || getCookie(OLD_CLICK_ID);
110+
const cookie = getCookie(CLICK_ID);
112111

113112
// If the cookie is not set
114113
// or the cookie is set and is not the same as the clickId + attribution model is 'last-click'
115114
// then set the cookie
116115
if (!cookie || (cookie !== clickId && attributionModel === 'last-click')) {
117116
setCookie(CLICK_ID, clickId, cookieOptions);
118-
setCookie(OLD_CLICK_ID, clickId, cookieOptions);
119117
}
120118
}
121119

@@ -125,7 +123,7 @@
125123
const { apiHost, shortDomain, queryParam } = getOptions(script);
126124

127125
// When the clickId is present in the URL, set the cookie (?dub_id=...)
128-
let clickId = searchParams.get(CLICK_ID) || searchParams.get(OLD_CLICK_ID);
126+
const clickId = searchParams.get(CLICK_ID);
129127

130128
if (clickId) {
131129
checkCookieAndSet(clickId);

0 commit comments

Comments
 (0)