When you have implemented enhanced e-commerce within GTM, it’s important to check if all the events are correctly pushed to the DataLayer. However, capturing an event within GTM does not necessarily have to mean that we have captured the cart accurately. This document shows how you can check if the cart has been captured correctly.

For Google Tag Manager, we are using the standard of Google, as explained over here. It’s also possible to use another method of sending carts to our script, elaborated here. Furthermore, it’s also possible to implement the cart script hardcoded if the tracking script is placed hardcoded as well. You can find the script over here.

After the scripts have been installed, go to your website. Right-click on your website, and click on inspect website. Now go to your network tab and refresh the page.

Filter on “idgoal” and add one item to the cart. You will see a response within your network if the carts are registered correctly. The response contains the properties that have been sent dynamically to our tracking script, like the itemid, name, price, quantity.

You can read more about the validation here.

Another essential thing to note here is that the itemid sent to the tracking script needs to match the itemid or the SKU of the content item within Datatrics. When this is the case, we can exactly see which items the visitor put in their cart.

If you don’t see the above in your network, something is wrongly configured within the data sent to our script. You need to troubleshoot this to find a solution. If you do see the “idgoal” going off in your network, it means we have successfully captured the item in our database.

You can use the following endpoint to see your abandoned carts:

http://api.datatrics.com/2.0/project/{{projectid}}/sale?q[goalid]=-1&apikey={{apikey}}

The response will look as follows:

Did this answer your question?