-
Notifications
You must be signed in to change notification settings - Fork 1
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
[HS-1071657] Migrate cart and view product data layer events to GA4 #1083
Conversation
I'd prefer the first 2 commits to be squashed together before merging. |
Previously, focusing on cartRemove would cause those tests to fail because it was relying on cartAdd or buildProductVar to initialize digitalData
92c61b7
to
db46df5
Compare
Will requested that We should consider sending a boolean instead of the strings |
According to Will, this change is not high urgency and wait until after the code freeze to be merged. |
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.
Everything looks great! Thanks for improving my code with the testingTransaction
detail: { | ||
products: [generateProduct(modifiedProductData)] | ||
} | ||
// value is unavailable until the user selects a gift amount |
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.
Will there ever be a view_item
which has a value? If no, should we have it this object, or do the analytics guys need it?
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 question. view_item
won't ever have a value
amount at this stage because the user hasn't selected the gift amount or frequency yet. When I implemented the GA4 spec for branded checkout, the spec docs said, "If no value exists for an attribute in the dataLayer, please pass JavaScript undefined
as the value." That's why I'm passing undefined
instead of omitting that field.
Migrate add_to_cart, remove_from_cart, and view_item events to GA4.
https://secure.helpscout.net/conversation/2457822430/1071657?viewId=7296729