-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Add collection of Snap cookie1 #1118
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
feat: Add collection of Snap cookie1 #1118
Conversation
| 'wbraid', | ||
| 'ttclid', | ||
| 'ScCid', | ||
| 'sc_cookie1', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the confusion here. They cookie key you should capture is _scid. sc_cookie1 is the parameter name that this value is sent to CAPI as. Some information about this can be found here.
| jest.spyOn(Date, 'now').mockImplementation(() => 42); | ||
| // Query params | ||
| const url = new URL('https://www.example.com/?fbclid=abc&gclid=g1&rtid=rt1&rclid=rc1&ScCid=snap1'); | ||
| const url = new URL('https://www.example.com/?fbclid=abc&gclid=g1&rtid=rt1&rclid=rc1&ScCid=snap1&sc_cookie1=cookie1'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cookie ID (_scid) would only be found in the cookies. We wouldn't expect to see it as a URL parameter.
alexs-mparticle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I only have one comment that may be a footgun for a future developer.
| const url = new URL('https://www.example.com/?ScCid=1234'); | ||
|
|
||
| window.document.cookie = '_scid=cookie1-from-cookie'; | ||
| window.document.cookie = '_cookie1=1234'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| window.document.cookie = '_cookie1=1234'; | |
| window.document.cookie = '_cookie1=some-cookie-value'; |
I would use a different value for _cookie here, or ScCid below. IIRC, this is just a mock value but since they look the same (1234), this may lead to some confusion later when troubleshooting or debugging. I would use a different value so that it's clear that they're not the same.
|


Background
Add native collection of Snap's cookie1
What Has Changed
Add new integration cookie param and tests
Screenshots/Video
Checklist
Additional Notes
Reference Issue (For employees only. Ignore if you are an outside contributor)