Snowplow eCommerce Plugin


We are implementing Snowplow eCommerce tracking with the newer plugin (

This works great for most events, however not for add_to_cart and 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 unstruct_add_to_cart schema.

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?


Hi @volderette,

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 trackAddToCart method:

  1. the new Snowplow Ecommerce
  2. the old Ecommerce plugin

The 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:

  1. Make use of the sp.lite.js version which doesn’t include it. You can download the file from the tracker releases on Github.
  2. 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.

1 Like

Thank you @Ada!