-
Notifications
You must be signed in to change notification settings - Fork 8
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: Report purchase events to mParticle when bundling ecommerce data #50
Conversation
src/BrazeKit-dev.js
Outdated
@@ -129,6 +129,8 @@ var constructor = function () { | |||
quantity, | |||
eventAttributes | |||
); | |||
|
|||
return reportEvent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this be return reportEvent === true
? thats how at least other log events functions have it as and I think it makes sense in case its not true
? but also the video you shared for testing seems to be working as expected
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good attention to detail! Yes so it seems that Braze returns true
from when you call their login method already, so, so doing just return reportEvent
is fine. I'm not sure why we do return reportEvent === true
since it is essentially the same thing. For now, to be consistent, I will just follow that format even though it's unnecessary, but I can make a ticket to refactor in the future to just return the boolean instead of the equivalence.
test/tests.js
Outdated
@@ -1756,6 +1756,7 @@ user.getUserIdentities is not a function,\n`; | |||
baz: 'bar', | |||
}; | |||
|
|||
debugger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noobie question, but wouldn't this pause the process of the test running and should be removed? I might be wrong
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is a mistake. I left it here. We should never have debugger
in live code.
test/tests.js
Outdated
@@ -1832,6 +1833,8 @@ user.getUserIdentities is not a function,\n`; | |||
var purchaseEventProperties = window.braze.purchaseEventProperties[0]; | |||
|
|||
purchaseEventProperties.should.eql(expectedPurchaseEvent); | |||
|
|||
reportService.event.should.be.ok(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this should be more like
reportService.event.should.have.property( 'EventName', 'eCommerce - Purchase' );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think being more specific is a good call. Will update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Instructions
development
Summary
Testing Plan
Link to test app showing the fix
https://share.zight.com/kpuvJZvD
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)