How do I add Google Analytics to Shopify?

Install Shopify’s Google & YouTube sales channel, open it, and connect a Google Analytics 4 property in its Google Analytics section (you can create one there). You don’t need a Merchant Center account for this. Don’t paste the Google tag into your theme: Shopify sends the store events through the channel, and in the EU visitors must accept cookies first.

Create a free accountFree for up to three sites. No card needed.

Updated 1 December 2026

Step by step

  1. In your Shopify admin, add the Google & YouTube sales channel if you don’t have it.
  2. Open it and connect your Google account.
  3. In the Google Analytics section, select or create a GA4 property and click Connect.
  4. Make sure your store shows a cookie banner, so EU visitors can say yes.
  5. Open your store in a private window, accept cookies, and check Realtime in Google Analytics.

If you had an old Google tag

If you added Google Analytics some other way before, Shopify may have turned it into a custom pixel, which Shopify says can measure less well. Move it to the Google & YouTube channel and remove the old code, so visits aren’t counted twice.

What you will and won’t see

GA4 gets page views, add to cart, checkout and purchases from the channel. It only sees visitors who accept cookies, so purchases and visits in GA4 will be lower than in Shopify’s orders. For complete visit counts by source without a banner, see the best analytics for Shopify and the Okidoki Shopify guide.

Where do I put the Google Analytics code in Shopify?

Nowhere: connect GA4 through the Google & YouTube sales channel instead of pasting code into your theme.

Do I need Google Merchant Center for Google Analytics on Shopify?

No. Shopify says Merchant Center is not needed to set up Google Analytics 4 alone.

More guides

Ask your website. Get answers right away.

Free for 3 sites. No credit card, no cookies, no code to touch.

Or look around a live demo first, no account needed →