How to Set Up Google Tag Manager and Track View Cart Conversion Actions on Your WooCommerce Store

by ShahzadaAliHassan - 27th July 2024

In this guide, we'll show you how to set up tracking for the "View Cart" event on your WooCommerce store using Google Tag Manager (GTM) and Google Ads. This will help you understand which users are viewing items in their cart and what those items are.

Table of Contents

  1. Introduction
  2. Checking Admin Access
  3. Installing GTM Plugin on WordPress
  4. Verifying GTM Installation
  5. Adding Data Layer Event for View Cart
  6. Creating Conversion Action in Google Ads
  7. Configuring Conversion Tracking Tags
  8. Testing and Verifying Tags
  9. Publishing the Container
  10. Conclusion

Introduction

By the end of this guide, you will be able to track the "View Cart" event on your Google Ads account for your WooCommerce store using Google Tag Manager. This event helps you see which users are visiting your cart and what items they are viewing.

Checking Admin Access

  1. WordPress:

    • Go to the back end of your WordPress site.
    • Click on "Users" and find your email address.
    • Ensure you have administrator access.
  2. Google Tag Manager:

    • Open your GTM container.
    • Click on "Admin," then "User Management."
    • Ensure your email has publish access to the container.
  3. Google Ads:

    • Go to your Google Ads account.
    • Navigate to "Admin" and click on "Access and Security."
    • Verify you have either standard or admin access.

Installing GTM Plugin on WordPress

  1. Add GTM Plugin:

    • Go to your WordPress backend, click on "Plugins," then "Add New."
    • Search for "GTM for WP" by Thomas Geiger.
    • Install and activate the plugin.
  2. Configure GTM Plugin:

    • Navigate to the plugin settings.
    • Enter your GTM container ID (found in GTM under "Admin").
    • Save changes. Ensure the container code is on and save again if needed.

Verifying GTM Installation

  1. Use GTM Preview Mode:

    • Go to your GTM account, click on "Workspaces," then "Preview."
    • Connect the debug session to your website to check if tags are firing correctly.
  2. Google Tag Assistant Chrome Extension:

    • Install the extension and check if the GTM container is firing properly.

Adding Data Layer Event for View Cart

  1. Enable WooCommerce Events:

    • In your WordPress backend, go to the GTM plugin settings.
    • Click on the "Integration" tab, then "WooCommerce."
    • Enable "Track e-commerce events" and "Clear e-commerce objects before new event."
    • Save changes.
  2. Test the Event:

    • Go to your WooCommerce cart page.
    • In the GTM debug window, verify that the "View Cart" event is firing.

Creating Conversion Action in Google Ads

  1. Create Conversion Action:

    • Go to your Google Ads account, click on "Goals," then "Summary."
    • Click the plus button to create a new conversion action.
    • Select "Website" and enter your website URL.
  2. Configure Conversion Action:

    • Create a manual action named "View Cart."
    • Set it to track dynamic values and save.

Configuring Conversion Tracking Tags

  1. Add Conversion Linker Tag:

    • In GTM, go to "Tags," click on "New," and select "Conversion Linker."
    • Set it to fire on all pages and save.
  2. Create Custom Event Trigger:

    • Create a new trigger with a custom event named "View Cart."
    • Configure the necessary variables: value, currency, and items array.
  3. Set Up Conversion Tracking Tag:

    • Create a new tag for Google Ads Conversion Tracking.
    • Use the conversion ID and label from your Google Ads account.
    • Configure the tag to fire on the "View Cart" event.
  4. Add Remarketing Tag:

    • Create a new tag for Google Ads Remarketing.
    • Configure it with the conversion ID and label, and set it to fire on the "View Cart" event.

Testing and Verifying Tags

  1. Use GTM Preview Mode:

    • Open the debug window and test the "View Cart" event on your WooCommerce site.
    • Verify that the conversion tracking and remarketing tags are firing correctly.
  2. Check Tag Assistant:

    • Ensure the Google Ads tag is firing and the event data is accurate.

Publishing the Container

  1. Submit GTM Container:
    • In GTM, click on "Submit" to publish your changes.
    • Name the version and describe the changes made.

Conclusion

By following these steps, you'll have successfully configured the "View Cart" event tracking for your WooCommerce store using GTM and Google Ads. This setup will help you track important conversion actions and optimize your ad campaigns effectively. If you want to learn how to configure the "Begin Checkout" event, click here.