Files
calendar/packages/lib/cookie.ts
Amit SharmaandGitHub 81224f324a feat: google ads conversion tracking (#25198)
* feat: google ads conversion tracking

* gaClientid

* store gclid in stripe metadata

* tracking only in the us

* track google campaign id as well

* rename gclid -> google ads

* fix: build

* fix

* refactor

* fix: type check

* fix: type check

* fix: type check

* fix: type check

* fix: store it in cookie

* refactor

* fix

* cleanup

* linked ads tracking

* refactor checkout session tracking
2025-11-25 12:58:10 +00:00

17 lines
422 B
TypeScript

export const getCookie = (name: string) => {
if (typeof document === "undefined") {
return null;
}
return document.cookie
.split(";")
.find((cookie) => cookie.trim().startsWith(`${name}=`))
?.split("=")[1];
};
export const setCookie = (name: string, value: string, options: string) => {
if (typeof document === "undefined") {
return;
}
document.cookie = `${name}=${value}; ${options}`;
};