Google Analytics 4 select_item event

Hello there,

we noticed that Mergado Pack for Woocommerce is sending the select_item event to GA4 which is a nice feature but it seems that this event is sent when the product page is rendered. I checked the source code and this is done when the HTTP Referrer is part of the website.

I am afraid the timing here is not the ideal because according to the documentation ([GA4] Recommended events - Analytics Help), the event should be sent when a product is selected. But given the current implementation, the event is recorder much later.

Would it be possible to improve tracking of this event, so it complies with the GA4 documentation?

Thanks,
Honza

Hello,

Thank you for reaching out to our support team. First of all, we apologize for the delayed response to your question. My response here will explain why the integration is designed this way, rather than providing an exact procedure to resolve the issue.

The implementation is indeed done in the manner you are proposing. Currently, there is a situation where view_item is triggered first, followed by select_item. Ideally, this should happen in the reverse order. We will swap this sequence without major complications.

The general integration for Mergado PACK is functional for the majority of customers. This means that overriding it so that the event is sent before the redirect is possible, but it would cause issues for customers using custom links without a standard WooCommerce class. The same applies to customers with their own list of products not using the default WooCommerce loops.

The official definition is somewhat vague on this matter. Does selecting an item mean ticking it or clicking it? The menu and list can also be interpreted as any place on the page.

At this moment, we can only think of one other improvement / extension. If the current implementation does not suit your needs, we can add switches for individual events (on/off), allowing everyone to implement their specific use case. Would this be a suitable solution for you?

Best regards
Mergado PACK team

Hello Robin,

thanks for your reply. I understand your point of view and the argument that any customization could easily break the tracking of this event.

I think we will just accept the current behaviour for now. Although the switches sound like a good idea in general since some customers may want to “block” tracking of some events.

Thanks for your support!
Honza

1 Like