Skip to content

Conversation

@alexs-mparticle
Copy link
Collaborator

@alexs-mparticle alexs-mparticle commented Mar 24, 2025

Summary

Add User Filtering logic to Rokt Kit

Testing Plan

  • Using a sample app, attempt to pass in attributes to window.mParticle.Rokt.selectPlacement that have been filtered via the mParticle UI and verify the filtered attributes are not passed through.

@alexs-mparticle alexs-mparticle marked this pull request as ready for review March 25, 2025 16:47
Copy link

@BrandonStalnaker BrandonStalnaker left a comment

Choose a reason for hiding this comment

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

The logic looks good to me

Copy link
Collaborator

@rmi22186 rmi22186 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. mostly nits. tests?

src/Rokt-Kit.js Outdated
service,
testMode,
trackerId,
_userAttributes
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's label this filteredUserAttributes so it's distinct (and that's what it is regardless of what this was originally named)

Suggested change
_userAttributes
filteredUserAttributes

src/Rokt-Kit.js Outdated
self.filters = window.mParticle.Rokt.filters;

// Attaches the launcher and kit to the Rokt manager
window.mParticle.Rokt.attachLauncher(launcher);
Copy link
Collaborator

Choose a reason for hiding this comment

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

we don't need to attach the launcher anymore here. instead it should still notify mParticle.Rokt that it is now available and the rokt kit is ready so that the core sdk can fire of the queued events

Copy link
Collaborator

Choose a reason for hiding this comment

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

seems like when you attach the kit it then calls processMessageQueue on the core SDK, so i think this is fine and we can remove attachLauncher completely.

src/Rokt-Kit.js Outdated

function selectPlacements(options) {
var attributes = (options && options.attributes) || {};
var placementAttributes = mergeObjects(attributes, self.userAttributes);
Copy link
Collaborator

Choose a reason for hiding this comment

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

i would flip these, so that the attributes passed in from the customer override anything we have cached.

@alexs-mparticle alexs-mparticle force-pushed the feat/SQDSDKS-7159-user-filtering branch from 63f464b to a791b35 Compare March 27, 2025 18:26
@alexs-mparticle alexs-mparticle merged commit 0355835 into development Mar 27, 2025
4 checks passed
crisryantan added a commit that referenced this pull request Mar 31, 2025
…ion-name

* development:
  feat: Add User Filtering to Kit (#9)
  fix: Add Test Framework (#11)
  feat: replace sandboxMode check with mParticle.getEnvironment() (#12)
  chore(build): Generate latest bundle [skip ci]
  fix: Reduce Rokt Kit Bundle Size (#7)
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.

4 participants