Screenshot of the Ecommerce section of Google Analytics

Hooking up your ecommerce store to Google Analytics


So you’ve got Google Analytics set up on your website where you also have an ecommerce store. What if, you ask, there was a way to connect the two together to make tracking your online store a little easier.

Good news: there is.

There’s a function inside of Analytics that allows you to do just that. The Google Analytics ecommerce tracking feature allows you to track your sales, including conversion rates, products, total sales and a lot more.

Setting this up can be a little bit complicated depending on what you’re using to power your online store. But taking the time to get it up and running is so worth it in the end.

How to hook up your ecommerce store to Google Analytics

Actually hooking up your ecommerce store to Google Analytics is pretty easy, but the challenging part is figuring out how to make it work with whatever vendor or plugin you’re using for your online store.

For example, how you would do this with a Shopify account would be way different than if you were using a WordPress plugin like WooCommerce or Easy Digital Downloads. There are a lot of variances so there’s no one real answer that’s going to work for everyone.

So as a general guide, this is the JavaScript code that Google needs in order to track your ecommerce store.

ga( 'require', 'ecommerce' );
ga( 'ecommerce:addTransaction', {
    'id': '',
    'affiliation': '',
    'revenue': '',
} );
ga('ecommerce:addItem', {
    'id': '',
    'name': '',
    'sku': '',
    'price': '',
    'quantity': '',
    'currency': ''

From there, how you fill in those values will depend on what you’re using. For simplicity’s sake, here’s a list of resources on how to hook it up based on what you’re using.

When you’ve gotten that taken care of, it’s time to learn about what you can learn from the data you receive.

What data can you gather from this?

Really, you can gather a ton of data from the Google Analytics ecommerce tracking about your online store. Obviously you have your basics: how many products you sold, what products are selling the best, how much revenue you made in a certain period of time, etc. Really that’s a lot of things that you can probably already see from whatever vendor or plugin you’re using.

But Google Analytics ecommerce goes deeper than that. The biggest KPI or key performance indicator that you gain with this tracking is the conversion rate. I’m sure some vendors have this somewhere, but Google puts it front and center. You can see the percentage of people that come to your website and become a paying customer. And that can help you figure out if you need to look into making changes to your website to help that.

You can also see how long it takes someone to complete a purchase, which could help you figure out if people might be enthusiastic about purchasing a product (like coming from an advertisement) or even if they might be having trouble or searching around to find the right product.

And finally you can see how each individual product is doing compared to your other products to see what might need to be changed or what could be better.

What can you learn and do from this information?

Like everything to do with regular analytics tracking, using ecommerce tracking is all about figuring out what’s working and what’s not working.

You can figure out what part of the process needs the most work. Are people just not coming to your website and you need to fix your SEO and advertising? Or are people getting to your website and not liking what they are seeing and leaving? And that goes for the website as a whole and for individual products.

You can also learn if your website is helping or hindering your efforts. If you have a high average purchase time and/or a really low conversion rate, then you might want to see if your website is having issues. Is it hard to navigate around the website and checkout? Or are people just not liking what they are seeing with your products?

And overall, you can figure out if your website is helping your business or not. If you’re not getting the sales you want and the metrics you see aren’t looking too good, it might be time to take a hard look at your website and make some big changes.

But take the time to look over the Google Analytics ecommerce section. There’s a lot going on here and there are metrics that will matter to you and no one else and vice versa. So go through and find the metrics that matter to you, start tracking them and then use that data to make decisions about your site.

This can make all the difference between having a website and online store that helps your business and one that’s just a liability.

Keep Learning with the Small Business Websites Newsletter

There’s a lot to learn when it comes to websites. How do you build a website that’s going to help your business grow? How do you manage a website to help your business grow? What’s the latest website news that you should know about? What are some websites you can look to for inspiration?

The Small Business Websites Newsletter helps you answer each of these questions. The biweekly newsletter will take a deep dive into some website-related topic, like SEO, WordPress, how to plan a website and more, to help you learn more about websites. I’ll also include some website news that you should know about as well as add inspiration I’ve found that might help you. And you’ll even get discounts for various products I offer. And all of this is for free.

So if you want to be better at building or managing your small business website (or any website for that matter), then you’ll want to sign up today!

"*" indicates required fields

GDPR Compliance*
This field is for validation purposes and should be left unchanged.