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

Learn how to configure Google Tag Manager on your WooCommerce store to track view cart conversion actions. This guide covers setting up Google Tag Manager, adding the necessary data layers, and ensuring accurate event tracking for better Google Ads targeting.

Shahzada Ali Hassan

3 min read0 views

Watch on YouTube

Check your site's tracking

Enter your website to see how good its tracking is, and whether Meta is likely restricting it.

Run a free audit

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.

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.

Set up in about 5 minutes. Events in Events Manager within about 30.

~5 min setupwithin ~30 min
Setting up
  • 7-day free trialon every eligible domain, one per domain
  • $297/moper subdomain
  • We set up the first domain with youfounder included
  • 30-day money-back guaranteeand cancel any time in the trial
  • We keep working with youuntil it is fixed

Payment method required at checkout. One trial per domain. The 30 minutes start once tracking is installed and events fire; it is visibility in Events Manager, not same-day ROAS.