This works great for most events, however not for
remove_from_cart. When triggering a cart event, it seems this triggers the older ecommerce tracking instead.
I would expect that the generated event has a
unstruct_snowplow_ecommerce_action schema with a type property of “add_to_cart”. Instead we are getting an event with
The docs for both look identical in terms of function naming and we are using sp.js.
What we want to use:
What’s probably triggered instead:
How would we be able to trigger the right event?
Thank you for raising this problem! We will discuss internally in the team how to solve this so that the problem doesn’t appear in the future. In the meantime, below are some recommendations how you can solve it on your side.
As you said the problem is caused by to two tracker plugins adding the same
- the new Snowplow Ecommerce
- the old Ecommerce plugin
sp.js file that you use in your app, includes the old Ecommerce plugin by default. You will need to remove the plugin in order to make the new Snowplow Ecommerce work properly. You can either:
- Make use of the
sp.lite.js version which doesn’t include it. You can download the file from the tracker releases on Github.
- Or build your custom
sp.js file using exactly the plugins that you need (this is recommended). You can follow this guide for building the file using custom plugins.
Hope that helps!
Thank you @matus, we will try to replace the library. Right now we are using the one provided by the sGTM template, so we will probably have to look for a different implementation.
Hi @volderette !
It is true that the sGTM Client does not offer an option to serve
sp.min.js, but that would be a nice to have! Opened this issue on GitHub to consider adding this option for next release.