Ramadan Mubarak

00
Days
00
Hours
00
Minute
00
Second
> Home > docs > Marketing & Growth Tools > How to track “Add to Cart and Purchase Event” with Google Analytics

By integrating Google Analytics with your StoreEngine store, you can effectively track key user actions such as Add to Cart and Purchase events. This allows you to see exactly when customers add products to their cart or successfully complete a purchase.

Tracking these events helps you:

  • Understand customer behavior
  • Measure conversion performance
  • Make data-driven decisions to optimize your sales funnel and overall store experience

In this guide, we’ll walk you through two reliable methods to connect StoreEngine with Google Analytics for tracking these events.

Methods Covered in This Guide

  • Using the Google Site Kit Plugin
  • Using Google Tag Manager (GTM)

Both methods are explained step by step, allowing you to choose the one that best fits your setup and tracking needs.

Note: Regardless of the method you choose, Google Analytics must be installed and active on your website. The easiest and most beginner-friendly way to do this is by using the Google Site Kit plugin.

How to track the Event using the Site Kit plugin

To automatically track Add to Cart and Purchase events, install and activate the Google Site Kit plugin on your WordPress website.

Once connected, the plugin displays your Google Analytics status directly in the WordPress admin dashboard and begins tracking supported events automatically.

Site Kit plugin

Why Choose This Method?

This approach works smoothly and without complexity, making it ideal if your goal is only to track Add to Cart and Purchase events. Once enabled, every time a customer adds a product to their cart or completes a purchase, the data is automatically recorded in your Google Analytics reports.

If you need to track additional or advanced events, Google Tag Manager is the better option.

Simple analogy: Using StoreEngine directly with Google Analytics is like a phone that automatically calls your friend when a purchase happens. 

Using Google Tag Manager adds a smart intermediary that can forward that call to multiple destinations. We’ll help you set up that call forwarding next.

Tracking Custom Events Using Google Tag Manager

In this section, we’ll show you how to track custom Google Analytics events in your StoreEngine store using Google Tag Manager (GTM).

Custom event tracking helps you understand:

  • When users click Buy Now or the checkout buttons
  • Which products or pages receive the most engagement
  • How users behave throughout the entire purchase journey

This data enables more accurate marketing analysis and better optimization decisions.

Setting Up Google Tag Manager for Multi-Event Tracking

We’ll start by tracking the Test event. Once configured, the same setup can be reused to track other events such as Search, Initiate Checkout, Start Trial, and more.

Step 1: Create a Google Tag Manager Account

Create a Google Tag Manager account and link it to your WordPress website. This is a simple process that involves adding the GTM code snippet to your site header. You can insert the code manually or use plugins such as HFCM to make the process easier.

Step 2: Create a Custom Event Trigger

  1. Log in to your Google Tag Manager account and open your desired container.
  2. From the left-hand menu, click Triggers.
  3. Click New to create a new trigger.
  4. Open Trigger Configuration.
Triggering configuration
  1. Select Custom Event as the trigger type.

Once selected, you’ll be redirected to the custom event configuration page.

Trigger type

On this page, enter the Event Name and select the All Custom Events option.

After filling in the required fields, simply click the Save button in the top-right corner of the page to save your configuration.

 All Custom Events

Now that we have the trigger, we need to create the tags for Google Analytics.

Creating a Google Analytics Tag in Google Tag Manager for Event Tracking

Now we are going to cover the steps to create the Google Analytics Tag using Google Tag Manager:

Step 1: Create a New Tag and configure it:

  • In your GTM container, go to Tags
  • Click the New button to create a new tag.
  • Give your tag a descriptive name, like “GA4 – View Product.”
  • In the Tag Configuration section, select Google Analytics → Analytics: GA4 Event as the tag type.
Google Analytics

Step 2: Configure Google Analytics Settings:

  • Enter your GA4 Measurement ID and Event Name in their respective fields. To find your Measurement ID in your Google Analytics account.
 Configure Google Analytics Settings
  • In the Triggering section, click to add a trigger.
  • Choose the custom event trigger you created earlier (For example, “Event – Test”).
Custom Event

Step 3: Save Your Tag and Publish Your Changes:

  • Click Save to save your Google Analytics Tag.
  • After creating the tag and associating it with the trigger, click the Submit/Publish button in the upper-right corner to publish your changes live.

By following these steps, you’ll have set up the Google Analytics Tag in Google Tag Manager. GTM will fire when the Test event occurs on your website.

Now you just need to replicate the same steps for all the events you want to track.

Google Analytics

By following the steps above, you can successfully track Add to Cart, Purchase, and other custom events using Google Tag Manager. This approach allows you to reuse triggers across multiple platforms—such as Google Analytics, Facebook Pixel, and other marketing tools—making your tracking setup scalable and efficient.

With accurate event tracking in place, you’ll gain deeper insights into user behavior and be better equipped to optimize conversions and improve your overall store performance.