Skip to content

Conversation

@jaissica12
Copy link
Contributor

Background

  • Rokt cookie syncs need to respect user privacy preferences (noTargeting, noFunctional flag) passed via launcherOptions. This is a workaround to block Rokt cookie syncs without requiring advertisers to implement the full consent framework.

What Has Changed

  • privacyManager.ts: Stores noFunctional and noTargeting flags from launcherOptions
  • cookieSyncManager.ts: Blocks Rokt (moduleId 1277) cookie sync when noTargeting is true
  • Tests: Jest unit tests + integration 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)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds privacy flag support to control Rokt cookie syncing based on user consent preferences. It introduces a new PrivacyManager component that stores noFunctional and noTargeting flags from launcherOptions, and blocks Rokt (moduleId 1277) cookie syncs when noTargeting is true.

Changes:

  • Introduced PrivacyManager class to store and manage privacy flags from launcherOptions
  • Modified CookieSyncManager to check noTargeting flag and block Rokt cookie syncs when enabled
  • Added comprehensive unit tests (Jest) and integration tests for the privacy flag functionality

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/privacyManager.ts New component that manages privacy flags (noFunctional, noTargeting) with validation and default values
src/mp-instance.ts Initializes PrivacyManager and adds it to the SDK instance interface
src/cookieSyncManager.ts Adds Rokt module ID constant and implements privacy flag check to block Rokt cookie syncs
test/jest/privacyManager.spec.ts Unit tests for PrivacyManager covering initialization, defaults, and flag validation
test/jest/cookieSyncManager.spec.ts Unit tests verifying Rokt cookie sync blocking behavior based on noTargeting flag
test/jest/roktManager.spec.ts Test verifying privacy flags are passed through to RoktManager's launcherOptions
test/src/tests-cookie-syncing.ts Comprehensive integration tests covering edge cases like MPID changes, consent interaction, and multi-partner scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rmi22186
Copy link
Member

Just reviewed. I feel like having a full privacyManager is over-engineering for the scope of the problem. Lots of set up to just get a formal getter. (90 lines in the class for this).

There aren't other use cases for it right now, and if there is a future where we do more with privacy flags maybe this is the right approach, but I also think there would be a larger refactor incorporting the consent framework.

Seems like we could simply work with the existing Store.SDKConfig, and do something like:

if (moduleId === PARTNER_MODULE_IDS.Rokt && mpInstance._Store.SDKConfig.launcherOptions?.noTargeting === true) {    return;}

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@jaissica12 jaissica12 merged commit 3840afa into development Jan 20, 2026
27 of 32 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 20, 2026
# [2.53.0](v2.52.0...v2.53.0) (2026-01-20)

### Features

* map Rokt Privacy flags in cookieSyncManager ([#1140](#1140)) ([3840afa](3840afa))
* Migrate Logger to Typescript ([#1120](#1120)) ([#1141](#1141)) ([e8d1ef1](e8d1ef1))
@mparticle-automation
Copy link
Collaborator

🎉 This PR is included in version 2.53.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants