Conversation
| if (itemCount !== null) { | ||
| var parsedItemCount = makeNumber(itemCount); | ||
| if(data.eventType != "SignUp" && data.eventType != "sign_up" && data.eventType != "Lead" && data.eventType != "generate_lead") { | ||
| if(hasItemCount(data.eventType)) { |
There was a problem hiding this comment.
with automatic collection of ecommerce data, we sometimes get itemCount attached to the view content event type causing diagnostic issues.
| "add_to_wishlist": true, | ||
| "Purchase": true, | ||
| "purchase": true, | ||
| "Custom": true |
There was a problem hiding this comment.
Any reason not to have custom?
There was a problem hiding this comment.
I do not think "custom" is a real GA4 event name. since we collect GA4 events we need to make sure that we are checking for the eventType we expect and ones that come from automatic GA4 mapping
There was a problem hiding this comment.
Ohh so this is a combination of GA4 event names and Reddit Pixel event names?
There was a problem hiding this comment.
| eventMetadata.products = products; | ||
| } | ||
|
|
||
| var EVENTS_WITH_ITEM_COUNT = { |
There was a problem hiding this comment.
What's the change here? We are reducing the number of events we pass item count along with?
There was a problem hiding this comment.
yeah just making sure that we are not grabbing itemCount from unsupported event types. this map is the events that can use it
felix-levert-reddit
left a comment
There was a problem hiding this comment.
LGTM
Is this only an issue with itemCount or should we do something similar with other metadata fields too?
|
@felix-levert-reddit this itemCount one is a bit different because of a direct conflict with how GA4 handles the
but yeah good point, I should update the value and currency check as well to be more strict and exclude ViewContent, PageVisit, and Search |
|
@felix-levert-reddit updated the check here - 0bf3233 |
|
@TayshawnH Nice! Thank you |
💸 TL;DR
We should use itemCount if it is supported for that event - https://business.reddithelp.com/s/article/about-event-metadata