All How-To Guides
Shopify10 min·5 steps

How to Add Google Analytics to Shopify (2026 Step-by-Step Guide)

Shopify and Google Analytics 4 connect through the official Google & YouTube sales channel - no theme editing, no manual tag pasting, and ecommerce events (purchases, add-to-carts, view items) are wired automatically. The whole setup takes about 10 minutes if you already have a Google account.

What you'll need before you start

  • A Shopify store (any plan, including Basic)
  • Owner or staff account with permission to install apps
  • A Google account
  • An existing or new GA4 property

How to add Google Analytics on Shopify: Step-by-step

  1. 1

    Install the Google & YouTube channel from the Shopify App Store

    In your Shopify admin, click Sales channels in the sidebar (you may need to expand it), then the + next to Add sales channel. Find Google & YouTube in the list and click Add channel. This is Google's officially-built integration - safer than third-party Analytics apps, and free.

  2. 2

    Connect your Google account

    Open the Google & YouTube channel from the sidebar. Click Connect Google account and sign in with the account that owns (or will own) your GA4 property. Approve the requested permissions - the integration needs read/write access to a Merchant Center account and a GA4 property.

  3. 3

    Create or link your GA4 property

    The setup wizard offers two paths: Create a new GA4 property (Shopify scaffolds one for you) or Use an existing GA4 property. If you already have GA4 set up, pick the existing option and select your property from the dropdown. Either way, the integration will save the G-XXXXXXXXXX Measurement ID for you - no copy-pasting required.

  4. 4

    Enable enhanced ecommerce events

    In the Settings tab of the Google & YouTube channel, confirm that Send analytics data is toggled on. This is what wires the ecommerce events (view_item, add_to_cart, begin_checkout, purchase) into GA4 automatically. No extra code, no Liquid edits.

  5. 5

    Test a purchase to confirm the funnel works

    The Realtime report only shows that the page tag is firing - it doesn't prove the whole funnel works end-to-end. Run a test order: enable test payments (SettingsPaymentsManage on Shopify Payments → Bogus Gateway), buy something with the test card, then check GA4 within 5 minutes for a purchase event in ReportsRealtime.

How to verify your setup is working

After install, open your storefront in an incognito window and browse to a product page. Within 30 seconds, GA4's Realtime report (ReportsRealtime) should show one active user. To confirm ecommerce events specifically, watch the Event count by Event name tile - you should see page_view, view_item, and (after adding to cart) add_to_cart tick up.

Common issues and fixes

Realtime shows visits but no purchase events

Most often this is because the test order was placed in test mode but the store is still in development mode (a free Shopify account that hasn't picked a plan). Pick a plan, repeat the test order with a real card and refund it, and the purchase event should fire. If your store is on a paid plan and purchases still aren't tracking, confirm SettingsSend analytics data is on and that the GA4 property selected matches the one you're checking.

I had Universal Analytics installed via the old Shopify > Online Store > Preferences field

Shopify removed that field in 2024. Any UA snippet that was there is gone, and Universal Analytics stopped processing on July 1 2024 anyway. The Google & YouTube channel is the supported path now. Nothing to clean up.

I'm using a headless Shopify storefront (Hydrogen, Next.js, etc.)

The Google & YouTube channel only tags the standard Shopify-hosted storefront. For headless setups, install the GA4 tag yourself in your frontend framework (gtag.js or the GA4 SDK) and use the Storefront API's customer events webhook for purchase confirmation server-side.

Frequently asked questions

Is the Google & YouTube app free?

Yes. Google built and maintains it; Shopify hosts it in the App Store at no charge. There are no usage limits and no upsell to a paid version.

Do I need to edit my theme to add Google Analytics to Shopify?

No. The official Google & YouTube channel injects the tag through Shopify's app surface, not through the theme's Liquid files. You don't need to touch theme.liquid or any other template, and the tag survives theme updates and theme switches.

Can I add Google Analytics to Shopify without an app?

Technically yes - paste the GA4 global site tag into Online StoreThemesEdit codetheme.liquid right before the </head> tag, and into SettingsCheckoutOrder status page additional scripts for the conversion event. But you'll have to wire up ecommerce events yourself, which is easy to get wrong. The Google & YouTube channel does this for you and is the recommended path.

How do I track conversions from Shopify in GA4?

Once the Google & YouTube channel is connected, the purchase event fires on the order confirmation page. To mark it as a key event in GA4: open AdminEvents, find purchase, and toggle Mark as key event on. After that, conversion reports in GA4 will count Shopify orders.

Does Shopify's checkout work with Google Analytics?

Yes - the Google & YouTube channel automatically tracks checkout funnel events (begin_checkout, add_payment_info, add_shipping_info) and the final purchase. Shopify's checkout pages live on checkout.shopify.com by default, but the integration handles the cross-domain tracking for you.

Will GA4 work with Shopify's checkout extensibility?

Yes. The Google & YouTube channel was rebuilt for checkout extensibility (the new app-block-based checkout that all Shopify Plus stores must use by 2024). No additional configuration is needed when you migrate from old to new checkout.

Once you're set up, MeasureBoard turns the data into action

MeasureBoard connects to your analytics, search, and SEO tooling and generates AI-powered weekly reports, GEO readiness scores, and a dedicated AI analyst that answers questions in plain English. Free to start, connects in 30 seconds.

Get Started Free