Setup Google Analytics in Shopify

By Ilana Davis

If you’re not using Google Analytics in Shopify to track and measure your e-commerce site… well you should be. Unless of course, you have something even more robust. But let’s face it. Google Analytics is free and is incredibly insightful if used right.

So let’s start with that before you invest money elsewhere if you don’t have to.

1. Get a Google Analytics account

Visit https://analytics.google.com to create a Google Analytics account for your website domain. Obviously, if you don’t already have a Google account, you’ll need to create that too. Here’s Google’s documentation on getting setup if you need it. https://support.google.com/analytics/answer/1008015?hl=en

Go ahead. I’ll wait.

Once you’ve created your account and added your Shopify website, you’ll want to get a Tracking ID.

In your Google Analytics, select the Admin panel (likely at the bottom of the page). Look for Tracking Info and then Tracking Code.

Selection for Google Analytics

You’ll see a Tracking ID along with a Global Site Tag (gtag.js). This is javascript that we’ll need to add to your theme files.

2. Getting Google Analytics Into Shopify

Shopify sales channel preferences

In another window (or tab if you’re like me and have tabs galore), log in to your Shopify admin. Under the Sales Channel, select Online Store and then Preferences.

You’ll see a section for Google Analytics.

Shopify Google Analytics code box

Copy the Global Site Tag javascript from Google Analytics and past directly into this text box.

Don’t forget to click Save!

Important

Make sure you turn off password protection on your store. Folks can’t see your store with a password nor can Google. Once this is off, Google will start to track visitors.

This doesn’t tell me what I need to know

For some, setting up Google Analytics is enough.

For others who may want more details about visitor behaviors for your Shopify store, I encourage you to keep reading.

Still in Shopify’s admin, just under where you entered your Global Site Tag, click the checkbox to turn on Use Enhanced E-commerce. We’ll get to that next.

3. Turn On E-commerce Settings

Google Analytics has an E-commerce Setting. Many don’t know about this, especially if you’re new to e-commerce.

The E-commerce Setting will allow you to analyze purchase activity on your Shopify store. You’ll be able to see product and transaction information, average order value, e-commerce conversion rate, time to purchase and so much more.

To turn this on, go back to the Google Analytics Admin panel.

Look through the fields for E-commerce Settings under All Website Data.

Google Analytics ecommerce setting

Set Enable E-commerce toggle to On.

Voila

You’re all set.

We’ll your all set up. I’d also recommend setting up a few more items in Google Analytics like Goals and Funnels. But that’s another post.

If you’re concerned about how your Shopify site is performing, you might consider buying my Website Rescues. I fix dozens of problems just like this that impact Shopify sites.

JSON-LD for SEO

Get more organic search traffic from Google without having to fight for better rankings by utilizing search enhancements called Rich Results.