Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add worker which allows a user's landing UTM to be carried forward in a cookie through their site journey #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alxbridge
Copy link

No description provided.

Copy link
Member

@tomusher tomusher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

if (!hasUtmCookie(request)) {
const url = new URL(request.url);
if (STRIP_QUERYSTRING_KEYS.some((key) => url.searchParams.get(key))) {
return url.search;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't you return only the utm searchParams instead of the whole url.search? I have no idea how this cookie will be used so it might not matter too much.

let request = event.request;

// get value for setting a new UTM cookie
newUtmCookieValue = getUtmCookieValue(request);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
newUtmCookieValue = getUtmCookieValue(request);
const newUtmCookieValue = getUtmCookieValue(request);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants