GA4 PageView Event on Shopify using GTM

Every page visited by a user holds a wealth of data. Tracking these visits offers insights into popular products, effective landing pages, and potential areas of improvement. By monitoring the PageView event, retailers can strategize content placement, optimize product listings, and fine-tune user experience to maximize engagement and conversions.

Shahzada Ali Hassan

2 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

Introduction

Setting up your Shopify store with Google Analytics 4 (GA4) is essential for keeping track of your site's performance and user behavior. Leveraging the power of Google Tag Manager (GTM) simplifies this process. Here's how you can integrate them seamlessly.

Initial Steps: Setting Up Google Analytics and Tag Manager Accounts

  1. If you've already set up your Google Analytics and Google Tag Manager accounts, you can skip to the next section. If not, you'll need to create your Google Analytics and Google Tag Manager accounts.
  2. Ensure that you have the Google Tag Assistant Chrome extensions installed.

Installing the Google Tag Manager (GTM) Container on Shopify

  1. Log in to your GTM account.
  2. Navigate to the Admin section and select Container Settings.
  3. Under the install section, you'll find two tracking snippets. One is for the <head> and the other is for the <body> section of your site.
  4. Copy the tracking code for the <head>.
  5. On your Shopify dashboard, navigate to Online Store > Themes.
  6. Click on Edit Code and locate the theme.liquid file.
  7. Find the <head> tag and paste the GTM tracking code you copied.
  8. Return to GTM and grab the tracking code for the <body>.
  9. Back in the theme.liquid file, search for the <body> tag and paste the second tracking code in the next line.
  10. Save your changes.

Verifying GTM Installation

  1. Visit your Shopify store.
  2. Use the Google Tag Assistant Chrome extensions to check if GTM is correctly implemented. It should indicate that a GTM container has been found on the website.

Integrating Google Analytics 4 (GA4)

  1. In your GA4 account, click on Admin located at the bottom left.
  2. Go to Property Settings > Data Streams.
  3. Locate the relevant data stream (e.g., Web for Shopify) and copy the Measurement ID (G-XXXXXXXX).
  4. Return to your GTM workspace.
  5. Navigate to Variables and create a constant variable named "GA4 Measurement ID" with the copied ID.
  6. Now, go to Tags > New.
  7. Select Google Tag as the tag type.
  8. Insert your "GA4 Measurement ID" variable in Google Tag.
  9. Save your changes, rename the Tag to "GT GA4 Configuration Tag" and preview the workspace to ensure everything is functioning correctly.
  10. If all goes well, GA4 should now be capturing data from your Shopify store!

Conclusion

Integrating Google Analytics 4 with your Shopify store using Google Tag Manager is a straightforward process. By following these steps, you'll be well on your way to gaining valuable insights about your store's performance and user behavior.

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.