Search
Menu

You may have already done this in the old Analytics, but in this article I'll show you how to do it in Google Analytics 4 (GA4).

Before you start: you should already have this working (GA4 e-commerce tracking)

If you want to set up the add to cart and the remove from cart, you need to have two things already working. And those are:

  1. Google Analytics 4 e-commerce tracking
  2. A datalayer should be pushed when a product is added to your shopping cart or removed.

You can do the first one very easily with the help of my blog. For the second one, chances are you'll have to put the developer to work. Send him the following link and you should be fine: https://developers.google.com/analytics/devguides/collection/ga4/ecommerce?client_type=gtag.

Making add to cart measurable with Google Analytics 4

Go to Google Tag Manager and click the appropriate account.

Then click on "New tag" and then "New.

Then enter the following information:

Name the tag something similar to: GA4 - Event - add_to_cart

Configuration tag: add the GA4 you use in configuration there.

Event name: add_to_cart

Event parameters: items & {{DLV - ecommerce.items}}.

That will look like this!

add to cart tag google analytics 4

Now we move on to the trigger. There, choose 'custom event' and enter add_to_cart.

add to cart trigger ga4

Making remove from cart measurable with Google Analytics 4

Setting the remove from cart is basically the same thing, only of course with a different name.

Go to Google Tag Manager and click the appropriate account.

Then click on "New tag" and then "New.

Then enter the following information:

Name the tag something similar to: GA4 - Event - remove_from_cart.

Configuration tag: add the GA4 you use in configuration there.

Event name: remove_from_cart

Event parameters: items & {{DLV - ecommerce.items}}.

remove from cart google analytics 4

Now we move on to the trigger again. There again choose 'custom event' and enter remove_from_cart.

remove from cart trigger

The final step

If you have this set up correctly, then you just need to add the events in Google Analytics 4. You do this by going to the appropriate account in Analytics.

Next, click on 'Manage' and then 'events'. Enter both add to cart and remove from cart there as done in the example below.

event create google analytics 4

Once you've done that, you'll see the remove from cart and the add to cart reflected in Google Analytics 4. Check it out!

add to cart and remove from cart ga4

Leave a Reply

Your email address will not be published. Required fields are marked *

Most frequently asked questions about this blog