Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Support capturing click ids as custom flags in commerce events #939

Merged
merged 7 commits into from
Oct 25, 2024

Conversation

rmi22186
Copy link
Member

@rmi22186 rmi22186 commented Oct 24, 2024

Instructions

  1. PR target branch should be against development
  2. PR title name should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-title-check.yml
  3. PR branch prefix should follow this format: https://github.com/mParticle/mparticle-workflows/blob/main/.github/workflows/pr-branch-check-name.yml

Summary

  • Commerce events were having the custom flags for click ids supplanted completely by custom flags that were being passed from the user. This PR fixes that. Instead we extend the custom flags to include both the custom flags created by createEventObject as well as what is passed by the user, with the flags passed by the user taken as priority.

Testing Plan

Added unit tests for ecommerce and page view, as well as an additional for custom events.
Manually tested regular page events, pageViews, and commerce events with and without a custom flag of Facebook.ClickId. All behavior working as expected (passed in custom flag takes priority over captured query param)

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

test/src/tests-integration-capture.ts Outdated Show resolved Hide resolved

const testEvent = findEventFromRequest(fetchMock.calls(), 'Test Event');

const initialTimestamp = window.mParticle.getInstance()._IntegrationCapture.initialTimestamp;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you're pulling this value but not using it anywhere.

test/src/tests-integration-capture.ts Outdated Show resolved Hide resolved
test/src/tests-integration-capture.ts Outdated Show resolved Hide resolved
rmi22186 and others added 2 commits October 24, 2024 16:36
Co-authored-by: Alex S <49695018+alexs-mparticle@users.noreply.github.com>
Copy link

sonarcloud bot commented Oct 25, 2024

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

@rmi22186 rmi22186 merged commit 6fb2476 into development Oct 25, 2024
31 of 35 checks passed
github-actions bot pushed a commit that referenced this pull request Oct 28, 2024
## [2.30.2](v2.30.1...v2.30.2) (2024-10-28)

### Bug Fixes

* Support capturing click ids as custom flags in commerce events ([#939](#939)) ([6fb2476](6fb2476))
@mparticle-automation
Copy link
Collaborator

🎉 This PR is included in version 2.30.2 🎉

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.

3 participants