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
- Introduction
- Checking Admin Access
- Installing GTM Plugin on WordPress
- Verifying GTM Installation
- Adding Data Layer Event for View Cart
- Creating Conversion Action in Google Ads
- Configuring Conversion Tracking Tags
- Testing and Verifying Tags
- Publishing the Container
- 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
-
WordPress:
- Go to the back end of your WordPress site.
- Click on "Users" and find your email address.
- Ensure you have administrator access.
-
Google Tag Manager:
- Open your GTM container.
- Click on "Admin," then "User Management."
- Ensure your email has publish access to the container.
-
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
-
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.
-
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
-
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.
-
Google Tag Assistant Chrome Extension:
- Install the extension and check if the GTM container is firing properly.
Adding Data Layer Event for View Cart
-
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.
-
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
-
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.
-
Configure Conversion Action:
- Create a manual action named "View Cart."
- Set it to track dynamic values and save.
Configuring Conversion Tracking Tags
-
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.
-
Create Custom Event Trigger:
- Create a new trigger with a custom event named "View Cart."
- Configure the necessary variables: value, currency, and items array.
-
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.
-
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
-
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.
-
Check Tag Assistant:
- Ensure the Google Ads tag is firing and the event data is accurate.
Publishing the Container
- 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.