Skip to content

Conversation

@gh-mmurph
Copy link
Contributor

@gh-mmurph gh-mmurph commented Nov 19, 2025

Background

Add native collection of Snap's cookie1

What Has Changed

Add new integration cookie param and tests

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • {Any additional information or context relevant to this PR}

Reference Issue (For employees only. Ignore if you are an outside contributor)

@gh-mmurph gh-mmurph changed the title Add collection of Snap cookie1 feat: Add collection of Snap cookie1 Nov 19, 2025
'wbraid',
'ttclid',
'ScCid',
'sc_cookie1',

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');

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.

Copy link
Collaborator

@alexs-mparticle alexs-mparticle left a 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';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
11.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@alexs-mparticle alexs-mparticle merged commit c7458c7 into mParticle:development Dec 8, 2025
48 of 51 checks passed
rmi22186 pushed a commit that referenced this pull request Dec 9, 2025
rmi22186 pushed a commit that referenced this pull request Dec 10, 2025
rmi22186 pushed a commit that referenced this pull request Dec 10, 2025
rmi22186 pushed a commit that referenced this pull request Dec 10, 2025
rmi22186 pushed a commit that referenced this pull request Dec 10, 2025
rmi22186 pushed a commit that referenced this pull request Dec 10, 2025
github-actions bot pushed a commit that referenced this pull request Dec 10, 2025
# [2.51.0](v2.50.1...v2.51.0) (2025-12-10)

### Bug Fixes

* Refactor extend() to handle prototype pollution cases in object merging ([#1125](#1125)) ([b16bdd2](b16bdd2))

### Features

* Add collection of Snap cookie1 ([#1118](#1118)) ([22490c6](22490c6))
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