feat: Pass $NoTargeting as User Attribute value when passed to launch…#1247
feat: Pass $NoTargeting as User Attribute value when passed to launch…#1247rmi22186 wants to merge 12 commits intodevelopmentfrom
Conversation
PR SummaryMedium Risk Overview Adds Reviewed by Cursor Bugbot for commit 11611dc. Bugbot is set up for automated code reviews on this repo. Configure here. |
…becomes false Extract $NoTargeting string to NO_TARGETING_ATTRIBUTE constant. Add removal logic in both identity response and re-init paths so the attribute doesn't persist when noTargeting is no longer true. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e316717. Configure here.
Move duplicated set/remove logic from identity.js and mp-instance.ts into syncNoTargetingAttribute() on CookieConsentManager. Add unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move syncNoTargetingAttribute call above processReadyQueue in identity.js. Add test verifying session_start batch includes $NoTargeting in user_attributes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Address SonarCloud preference for avoiding direct window references. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sponse Move syncNoTargetingAttribute call before processQueuedEvents so that events queued before the identity response (e.g. session_start) pick up the $NoTargeting user attribute via appendUserInfo. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…vent race Move syncNoTargetingAttribute inside the HTTP_OK block before sendUserIdentityChangeEvent. UIC events call sendEventToServer which triggers processQueuedEvents, draining the event queue before $NoTargeting was set — causing flaky test failures depending on whether prior tests left identity state that produced UIC events. Also update the test to verify $NoTargeting on a post-init event batch instead of the session_start batch, avoiding async upload timing issues from test pollution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add test verifying $NoTargeting is included in beacon batch user_attributes when user leaves the page. Uses triggerVisibilityHidden with a resetHistory flush to clear stale beacon calls from prior tests' BatchUploader instances whose event listeners persist across resets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|



Background
This feature enables customers who elect noTargeting to be filtered out of audiences for retargeting. Server expects this to now be set as a value for the user attribute as
$NoTargetingwith a booleantrue.What Has Changed
Add setUserAttribute in
parseIdentityResponse.Screenshots/Video
Checklist