Skip to content

feature: Map events to an attribute flag for selectPlacements#41

Merged
alexs-mparticle merged 8 commits into
developmentfrom
feature/SDKE-106-rta-attributes
Sep 2, 2025
Merged

feature: Map events to an attribute flag for selectPlacements#41
alexs-mparticle merged 8 commits into
developmentfrom
feature/SDKE-106-rta-attributes

Conversation

@alexs-mparticle
Copy link
Copy Markdown
Collaborator

Summary

Map events to an attribute flag for selectPlacements

Testing Plan

  • Use a sample app and map custom events to an attribute flag using the mParticle UI
  • Fire the mapped event using the sample app
  • Verify that the selectPlacement call is made with the attribute flag
  • Restart your browser and verify that values persist
  • End your session and verify that the values have cleared

This comment was marked as outdated.

Comment thread src/Rokt-Kit.js Outdated
Comment thread src/Rokt-Kit.js Outdated
Comment thread test/src/tests.js Outdated
Comment thread test/src/tests.js Outdated
Comment thread test/src/tests.js Outdated
Comment thread test/src/tests.js Outdated

This comment was marked as outdated.

Comment thread test/src/tests.js Outdated
Comment thread test/src/tests.js Outdated
]);
});

it('should parse a settings string with a stringified number value correctly', () => {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm still unclear about the meaning of this test. what about a stringified number is being tested? saw that you resolved the original comment but didn't see any changes

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The purpose of this test is to verify that if a setting string is parsed, the string hashes in the jsmap and map properties are not converted to numbers, but remain as strings.

For example, "jsmap":"-1484452948" should be come jsmap: '-1484452948' (sting) and not -1484452948 (number)

Copy link
Copy Markdown
Contributor

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 functionality to map events to attribute flags for the selectPlacements method in the Rokt forwarder. When configured events are fired, they set local session attributes that are then included in placement selection calls.

Key changes:

  • Added event mapping configuration parsing and lookup generation
  • Implemented event processing to set local session attributes for mapped events
  • Enhanced selectPlacements to include local session attributes in the request

Reviewed Changes

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

File Description
src/Rokt-Kit.js Implements core event mapping functionality, event processing, and local session attribute integration
test/src/tests.js Adds comprehensive test coverage for the new event mapping features and helper functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test/src/tests.js
Comment thread src/Rokt-Kit.js
Comment thread src/Rokt-Kit.js
Comment thread test/src/tests.js Outdated
Comment thread test/src/tests.js Outdated
Co-authored-by: Robert Ing <ring@mparticle.com>
…e-integrations/mparticle-javascript-integration-rokt into feature/SDKE-106-rta-attributes
@alexs-mparticle alexs-mparticle merged commit 613d790 into development Sep 2, 2025
2 of 4 checks passed
@alexs-mparticle alexs-mparticle deleted the feature/SDKE-106-rta-attributes branch March 25, 2026 15:16
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