How to Track Purchase Events on Your WooCommerce Store Using Google Tag Manager and Google Ads

Learn how to configure Google Tag Manager on your WooCommerce store to track purchase events. This guide walks you through setting up GTM, configuring data layers, and ensuring accurate event tracking for effective Google Ads campaigns.

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

If you're running a WooCommerce store and want to track purchase events using Google Ads and Google Tag Manager, this guide will walk you through the entire process. By the end, you'll be able to set up conversion tracking and ensure that every purchase on your website is recorded correctly in Google Ads.

Step 1: Ensure Proper Access to Your Accounts

Before you begin, you need to make sure you have the right access to your WordPress, Google Tag Manager, and Google Ads accounts.

  1. WordPress Admin Access:
    • Go to your WordPress dashboard.
    • Navigate to Users > All Users.
    • Find your email address and ensure it says "Administrator" under your role. This level of access is crucial to install plugins and configure settings.
  2. Google Tag Manager Access:
    • Open Google Tag Manager.
    • On the left side, go to Admin > User Management.
    • Ensure your email has "Publish" access under Container Permissions. If not, request access from the account owner.
  3. Google Ads Account Access:
    • Go to your Google Ads account.
    • Click on Tools & Settings > Access and Security.
    • Verify that you have "Admin" or "Standard" access.

Step 2: Set Up Google Tag Manager on Your Website

Install the GTM for WP Plugin

  1. In your WordPress dashboard, go to Plugins > Add New.
  2. Search for "GTM for WP" by Thomas Geiger.
  3. Click Install Now and then Activate.
  4. Once activated, go to the plugin's settings to add your Google Tag Manager container ID.
    • Find your container ID in Google Tag Manager under Admin > Container Settings.
    • Copy the ID and paste it into the GTM for WP plugin settings.
  5. Important: Ensure the container code is turned on after saving changes.

Verify GTM Installation

  1. In Google Tag Manager, click Workspace > Preview.
  2. Enter your website URL to start a debug session.
  3. Use the Tag Assistant Chrome extension to check if the GTM container is firing correctly on your website.

Step 3: Track Purchase Events with Google Tag Manager

Create Data Layer Variables

To capture all the necessary purchase data, create the following Data Layer Variables:

  • Currency: ecommerce.currency
  • Transaction ID: ecommerce.transaction_id
  • Value: ecommerce.value
  • Items Array: ecommerce.items
  • Customer Info: Create variables for customer first name, last name, email, address, city, state, postal code, and country.

Create Triggers

  1. Go to Triggers in Google Tag Manager.
  2. Create a new trigger:
    • Type: Custom Event
    • Event Name: purchase
    • Name the Trigger: "Custom Event - Purchase"

Create Tags for Conversion Tracking

  1. In Tags, create a new tag for Google Ads Conversion Tracking.
  2. Configure the tag with:
    • Conversion ID: (Use the ID from your Google Ads account)
    • Conversion Label: (Use the label from your Google Ads account)
    • Trigger: Select the "Custom Event - Purchase" trigger.
  3. Repeat this process to create tags for:
    • Google Ads Remarketing
    • User Provided Data

Step 4: Test Your Setup

  1. Return to the preview mode in Google Tag Manager.
  2. Perform a test purchase on your WooCommerce store.
  3. Ensure that all tags (Conversion Tracking, Remarketing, and User Provided Data) fire correctly on the thank you page.

Step 5: Publish Your Changes

Once you've verified everything is working, publish the changes in Google Tag Manager:

  1. Go to Submit > Publish.
  2. Name the version (e.g., "Google Ads Purchase Event Tracking").
  3. Click Publish.

You've successfully set up purchase event tracking for your WooCommerce store using Google Ads and Google Tag Manager! If you're interested in setting up tracking for other events, like "Begin Checkout," you can find more resources in related videos.

By following this guide, you'll ensure that every purchase made on your WooCommerce store is accurately tracked, helping you optimize your Google Ads campaigns effectively.

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.