Skip to content

Home / Blog / How to Add Google Tag to Shopify and Check It Works

Shopify & Ecommerce

How to Add Google Tag to Shopify and Check It Works

A simple walkthrough of the ways to connect Google Analytics 4 and Google Ads to your store, how to test them and what usually goes wrong. This guide on Google tag to Shopify covers consent, privacy and policy pages, common problems and how to fix them and summary.

By Ragnar Studio's12 October 20268 min read
Abstract workspace with a laptop showing an analytics dashboard and an online store admin screen

How to add Google tag to Shopify in short: you first create or open the tag in Google Analytics 4 or Google Ads, then connect it to your store through the Google and YouTube sales channel, through Shopify's customer events settings, or by pasting the snippet into your theme. The exact menus change from time to time, so this guide explains the idea and the generic steps, and you should follow the on-screen labels in your own accounts.

Key takeaways

  • Create or open the tag in Google Analytics 4 or Google Ads first.
  • Shopify offers three routes: the Google and YouTube channel, customer events, or pasting the snippet in theme code.
  • The Google and YouTube channel is a sensible default for beginners.
  • Set up the key store events and conversions, because installing the tag is only half the job.
  • Test that the tag fires, and add a clear privacy policy that explains tracking.

What the Google tag is and why a Shopify store needs it

The Google tag is a small piece of code that sits on your website and sends information about visits and actions to Google products. One tag can feed several tools, such as Google Analytics 4 for traffic reports, Google Ads for conversion tracking and remarketing, and Google Merchant Center for product data. It replaces the older habit of installing a separate script for each tool.

Without it, you cannot see which pages people visit, which channels bring orders or which ads lead to sales. Setting it up once, properly, is a basic part of running a store, and it is useful whether you rely on SEO, Google Ads or Meta Ads. If you are still building the store, our Shopify store setup checklist for beginners places tracking in the wider launch plan.

Before you start: what to have ready

  • Admin access to your Shopify store, preferably as the owner or a staff member with the right permissions.
  • A Google account that you control, ideally a business one rather than a freelancer's personal account, so you keep ownership.
  • A Google Analytics 4 property for your store, or permission to create one.
  • A Google Ads account if you plan to run ads or track conversions.
  • Your final domain connected, so you do not track the wrong address. See how to choose a domain name in India if you are still deciding.

Also decide who will own the data. If an agency or freelancer sets this up, ask them to add you as an administrator in each Google account, so you are never locked out.

Three ways to add Google tag to Shopify

Shopify stores usually have three routes. Which one is available or best can depend on your theme, your plan and the current Shopify interface.

  • The Google and YouTube sales channel: the easiest route for most stores. You install the channel from the Shopify app area, connect your Google account and select your Analytics, Ads and Merchant Center accounts. It can also help with product feeds.
  • Customer events or pixel settings: Shopify lets you add tracking through its customer events area, where you can add a custom pixel. This works with Shopify's checkout and respects customer privacy settings.
  • Pasting code into the theme: the older method, where you add the snippet to the theme code. It can still work for page views, but it does not always capture checkout events, and theme updates can overwrite it.

Menus and names may change, so treat the paths in this guide as a general map, not a fixed set of clicks. As a rough rule, choose the channel if you want the simplest guided setup and also plan to run Google Shopping or product feeds, choose a custom pixel if a developer or agency is managing detailed tracking, and use theme code only for a quick page view test or when the other options are not available to you.

Want this done for you? Ragnar Studio's handles Shopify Store Development. See how it works or get a free quote.

Method 1: connect through the Google and YouTube channel

This is a sensible default for beginners. The steps are generally as follows.

  1. In your Shopify admin, open the sales channels or apps area and add the Google and YouTube channel.
  2. Sign in with the Google account that owns your Analytics and Ads accounts.
  3. Choose or create the Google Analytics 4 property and Google Ads account you want to connect.
  4. Turn on the data sharing or conversion tracking options that the setup page offers, and review what each one does.
  5. Save, then wait for the connection to show as active.

The channel may also ask about product feed and Merchant Center settings. You can complete those later. Tracking is the first goal.

Method 2: add the tag through customer events

If you prefer manual control, you can use the custom pixel option in Shopify's settings. The idea is to paste the Google tag code and the event configuration you get from Google into a custom pixel, then connect it so it fires with your customer events.

  1. In Google Analytics, open your data stream for the website and copy the Google tag details (the measurement ID begins with G-).
  2. In Shopify, open your settings and find the customer events or pixels section.
  3. Add a custom pixel, give it a clear name and paste the tag code and event mapping.
  4. Check the permission and privacy settings for the pixel, then save and connect it.

This route needs care. A small mistake can double-count events or miss purchases, so test carefully, or ask a developer. Our Shopify store development service can handle setup and testing for you.

Method 3: paste the tag in your theme code

For simple page view tracking, you can add the Google tag snippet in the head section of the theme. Always duplicate your theme first, so you can roll back. Then paste the snippet in the right place in the theme layout file, save and preview.

The risks are real: a theme update may remove the snippet, and it may sit alongside another connection, such as the sales channel, causing duplicate tracking. If you change themes, you must add it again. For these reasons many developers now prefer the channel or pixel route. Choose one method, not several at once.

Set up Google Analytics 4 and Google Ads conversions

Having the tag installed is only the first half. You also need the right events. For a store, the key ones are product views, add to cart, begin checkout and purchase. The Google and YouTube channel can send standard ecommerce events automatically. With a manual setup, you map them yourself.

  • In Google Analytics 4, mark the purchase event as a key event (the interface may call it a conversion) so reports show it clearly.
  • In Google Ads, create a conversion action for purchases and link it to the tag using the conversion ID and label shown in the account.
  • Link your Google Analytics and Google Ads accounts so audiences and conversions can be shared.
  • Check that purchase values are sent in rupees and match your store currency.

If you plan to run campaigns, see our Google Ads management service and read SEO vs SEM to choose where to spend first.

How to test that your Google tag is working

Never assume it works. Test it right after setup.

  1. Open your store in a fresh browser window and visit a few pages.
  2. In Google Analytics 4, open the real-time report and look for your visit.
  3. Use Google's Tag Assistant or the debug tools in Analytics to see which events fire as you view a product, add to cart and begin checkout.
  4. Place a small test order if possible, or use a test mode, and confirm the purchase event with the correct value appears.
  5. Check that each purchase is counted once, not twice.
  6. Compare the order in Shopify with the event in Analytics: order value, currency and number of items should match.

Real-time data appears quickly, but standard reports can take longer, so allow time before judging the numbers.

Tracking collects information about visitors, so be open about it. Add a clear privacy policy that explains the analytics and advertising tools you use, and review Shopify's customer privacy and cookie banner settings to decide how consent is handled for your audience. Rules and settings change, and legal requirements depend on where your customers are, so check with a qualified advisor if you are unsure. Our guide to legal and policy pages for Indian online stores lists the pages most stores need.

Common problems and how to fix them

  • No data in reports: check you used the right measurement ID, the store domain matches, and the connection shows as active.
  • Double counting purchases: you probably have two methods installed. Remove one.
  • Missing purchase events: theme-only tags may not capture checkout. Use the channel or customer events route.
  • Wrong currency or value: verify the currency settings in Shopify and Analytics.
  • Your own visits inflate data: filter internal traffic in Analytics.
  • Ad conversions not matching orders: allow time, check attribution settings and confirm the conversion action is set as primary.

What to do after the tag is working

With data flowing, connect Google Search Console to see search queries and indexing, and review product page performance using your reports. Use real numbers to improve your listings; our Shopify product page optimization guide shows what to change first. For wider organic work, read the Shopify SEO guide for Indian stores and the ecommerce SEO guide.

Over time you can also build remarketing audiences in Google Ads, for example people who viewed a product but did not buy, and use Merchant Center to show products in Google listings. Start small, confirm the numbers match your Shopify orders, and add extras only when the basics are accurate. Remember that tracking only measures; it does not create sales. Results depend on your products, pricing, competition and budget, and nothing is guaranteed.

Summary

To add a Google tag to Shopify, create the tag in Google Analytics 4 or Ads, then connect it through the Google and YouTube channel, a custom pixel in customer events, or the theme code. Use a single method, set up purchase events, test with real-time reports and Tag Assistant, and keep privacy pages updated. Menus will change over time, so follow the labels you see. If you want it done and tested for you, our Shopify team will quote based on your setup.

Frequently asked questions

How do I add Google tag to Shopify?

Create or open your Google tag in Google Analytics 4 or Google Ads, then connect it using the Google and YouTube sales channel, a custom pixel in Shopify's customer events settings, or by pasting the snippet into your theme. Pick one method, test with real-time reports, and follow the current menu labels because they can change.

Is the Google tag the same as Google Analytics?

Not exactly. The Google tag is the code on your site that sends data to Google products. Google Analytics 4 is a reporting tool that receives and shows that data. One Google tag can also feed Google Ads and other tools, so you do not need a separate script for each. Not sure where to start with Google tag to Shopify? Email info@ragnarstudio.com and we will point you to the right option.

Do I need a developer to add the Google tag?

Often not. The Google and YouTube channel is designed for store owners to set up through a guided flow. A developer helps when you need custom events, a manual pixel, clean testing or fixes for double counting. If unsure, ask for a quote before changing theme code.

Where do I find my Google tag ID?

In Google Analytics 4, open the admin area, find your web data stream and look for the measurement ID, which usually begins with G-. In Google Ads, the conversion ID and label appear in the conversion action details. Interface names can change, so use the search or help option inside Google.

Why is my Shopify store not showing data in Google Analytics?

Common causes are a wrong measurement ID, a connection that is not active, an ad blocker in your test browser, a consent setting that blocks tracking, or data that has not yet reached standard reports. Check the real-time report first, then verify the ID, domain and installation method.

Why are purchases counted twice?

This usually happens when the tag is installed in more than one way, for example through the sales channel and again in the theme code. Remove the duplicate so only one method sends the purchase event, then test with a small order and check the event count.

Do I need a cookie banner after adding the Google tag?

Tracking and advertising tools collect visitor data, so you should have a clear privacy policy and review Shopify's customer privacy settings. Whether a banner is needed depends on your audience and location. Check current rules or ask a qualified advisor. This guide is not legal advice.

Can Ragnar Studio's set up Google tracking for my store?

Yes. We can connect Google Analytics 4, Google Ads conversions and related tools, then test the events. Share your store link and goals on WhatsApp, and we will send a custom quote based on what needs setting up. We do not guarantee sales or ad results.

Prefer to have tracking set up and tested by someone else? Our Shopify store development team can connect Google tools to your store and quote after reviewing your setup.

Free quote

Tell us about your Shopify store

Fill this short form and send it on WhatsApp. We reply with questions or a quote. Nothing is charged on the website.

  • Takes about two minutes
  • Goes straight to Ragnar Studio's on WhatsApp
  • Prefer email? Write to info@ragnarstudio.com

By sending, you agree that Ragnar Studio's may reply on WhatsApp about this enquiry.

Ready to start your project?

Tell us what you need. We reply on WhatsApp with questions, next steps and a quote.