Google Analytics for Shopify: Common Errors and How to Fix Them
Shopify Growth Specialist
Google Analytics data is a valuable tool that helps us make better decisions. We need to know how to market to the best customers. We need to make our stores better at selling. Analytics data is a great tool to do that.
But if that data is wrong, we are making bad decisions for the business. We need to know that we are building a solid foundation.
Since more than 3/4 of Google Analytics setups are broken to some degree, the first step is to audit Google Analytics. That means looking for basic errors that corrupt our data. This will cover a few of the most basic, frequent problems that will hurt your data collection efforts.
Common Google Analytics setup errors (That ruin your data and your decision making)
1. Incorrect/duplicate data
What it is: Code is placed in the wrong spot or placed twice
Why it happens: GA code is implemented through theme code edit or Google Tag Manager instead of through the Shopify backend panel. This causes data to not be reported properly, or to be reported twice.
Symptoms: Data from Google Analytics being way off from that reported by Shopify (some small difference is fine, a massive difference between the two is a cause for investigation. Extremely low bounce rates in GA also indicate that something is probably wrong with code implementation.
2. Bot/spider traffic falsely inflating traffic
What it is: Automated bots that act like a hit on your website. These can show up in your analytics data and skew your understanding of user behavior.
Why it happens: Bots can be search engine crawlers, or have malicious uses like malware distribution or intentional analytics spam. Either way, you don't want to count them in your data when making decisions.
Symptoms: If you filter bots from your GA reporting and your reported traffic and your traffic drops, you had that much bot traffic. Now it's not messing up your reporting. Rejoice, friend.
3. Lost & corrupted data
What it is: Google Analytics views are separate subsets of your Analytics reporting that let you look at specific data. The problem with only having one view is that you need to configure views. Doing so can change what data is collected or how it is treated. If you filter out or don't collect data in a certain view, it is gone forever, and cannot be recovered. The solution to that is multiple views.
Why it happens: Google Analytics defaults to just having one view when you set it up. They don't explain the value of multiple views to users, and most people never know the difference until it's too late.
Symptoms: If one day you apply changes and make a mistake, you could completely ruin your historical data. You'll know when it's too late. OR you won't know, and you'll make decisions based on corrupt data. Either way, there's your answer.
4. No goals
What it is: Goals are specific events that you can tell Google Analytics to watch out for. It enables more reporting and data collection surrounding those events and what lead up to them happening.
Why it happens: Honestly, most people just don't know they need goals, and they aren't always easy to setup.
Symptoms: You lose access to certain reports and to several insights into how your traffic converts into customers.
5. Traffic displaying the wrong source (Ruining your understanding of your marketing ROI)
What it is: Traffic that is coming from one place showing up as another in GA.
Why it happens: Two reasons: Marketers not tagging links properly and Google Analytics not reporting some traffic properly.
Symptoms: PPC reports as organic, social reports as referral, email reports as direct. This throws off your understanding of what traffic sources convert and what is or isn't worth investing in.
6. Missing out on ecommerce data
What it is: Enhanced Ecommerce is an option to pass a lot more data through to Google Analytics concerning your store, products, and customers. This allows you access to much of the same data as your Shopify backend, but with the added ability to look at the data with more depth to gain understanding.
Why it happens: It has to be enabled in more than one place to work, and most people don't understand the value they will get from it.
Symptoms: You don't have data on products, returns, checkout behavior, and a bunvh of other useful, ecommerce-related things in GA.
7. Fake referral traffic
What it is: Traffic that goes from your website to another place and then back to your site is tagged as a new visit referred by that website.
Why it happens: Things like leaving the site to go to a blog on a sub-domain (blog.yoursite.com) or third-party payment gateways (Amazon Pay, Google Pay, PayPal, etc.)
Symptoms: Referral traffic shows up that is actually coming from people already on your site. It's inaccurate and hidden in your reporting.
Fixing your Google Analytics & Shopify setup errors
This is not meant to cover the very first steps of signing up and setting up your Google Analytics account. If you are at that stage, here is Google's own documentation to help: https://support.google.com/analytics/answer/1008015?hl=en
What this is meant to do is take you into your current GA setup and make sure that you avoid some common setup errors that will otherwise wreck your data collection. I want you to know that the data you see is right. Some of this will apply to everyone, but some of it is specific to Shopify stores, because there are a couple of unique things there.
1. Google Analytics code placed poorly or duplicated
For a Shopify store, there is only one place your GA tracking code needs to be installed. That is on your Shopify backend. It can be found by logging to your Shopify admin and going to Online Store —> Preferences—> Google Analytics
The code that you are placing comes from inside your Google Analytics Admin. You can find it by logging in at: https://analytics.google.com, then going to Admin (gear icon in bottom right hand corner) —> Property Settings—> Tracking Info—> Tracking Code.
Potential Problems with this:
- Code in the wrong place- Google Tag Manager is a great tool, and very useful for Shopify stores. But you should not use it to implement Google Analytics or Facebook tracking codes. This should only be done in the Shopify backend. Same goes for adding Google Analytics code directly to theme files. If GA is installed in these places, it won't pass all the data you need through to GA properly, and you'll have bad data.
- Code placed multiple times- If you have GA implemented more than once, it will report more than once. That means everything that happens will get counted and reported twice to your GA. If the code is implemented anywhere other than the Shopify backend, it should be deleted from the other places.
- Using the wrong code- Universal Analytics is the most recent version, replacing and older version of GA code. If you get your code from the proper place in GA (Admin—> Property Settings—> Tracking Info—> Tracking Code) and paste it into the box show above, you will be fine. The problem comes with old setups where somebody installed the code a looooong time ago, and no one has done anything with it since then.
2. Filter out bot/spider traffic
This one is easy to fix. In Google Analytics, go to Admin—> View Settings, then look for bot filtering, and make sure the box is checked. You will need to do this for each view you create (except for your unfiltered view since it is, after all, unfiltered).
3. Setting up multiple views
You should have at least 3 views. Those views should be:
- Unfiltered- Raw, unfiltered data. This excludes nothing, and gives you a history going back and a way to restore some data sanity if your other views get messed up by a mistake in filtering or something else.
- Test- This is where you will test out other changes and filters to make sure that you don't trash your data with a change.
- Master- This is the view you will be using. It will have your filters, goals, ecom settings, etc.
These views are just about data integrity. There are other thoughts on views and how to use them, especially if you have bigger teams using analytics in your business. These 3 are a good place to start that balance data integrity and simplicity.
4. Set goals
You need goals for your store. Enhanced Ecommerce is great, but goals offer more flexibility. The most basic goal you need is a completed purchase goal that fires whenever someone makes it through checkout. You can read more about goals, why you should use them, and more in another article: Google Analytics Goals for Shopify.
Here is how you setup your completed checkout goal (which is your most important one):
Name- Checkout complete
Select ID and set- This isn't really important. You can leave it as-is.
Destination- Equal to: /checkout/thank_you Funnel- On (Steps Below)
Named -- Screen/Page
- Cart -- /cart
- Customer Address -- /checkout/customer_information
- Shipping Details -- /checkout/shipping
- Payment Step -- /checkout/payment
Goal value- Off
Verify Goal- Check that the goal is working. This should return the same number of transactions you have had in Shopify in the past 7 days. If it is off by more than just a little bit (timing and reporting differences), there is an issue with the goal.
Note- Make sure to leave the "Required" box set to no. Some setups won't involve a specific cart page, and you don't want that complication. You can leave the cart page off entirely if you choose to, it won't affect tracking conversions, but it will leave the cart page out of the funnel visualizing. This is really just a matter of whether you have some sort of floating/sidebar cart or a dedicated page.
You'll end up with a goal that looks like this:
5. Correct common (and costly) traffic source errors
PPC traffic showing up as organic- If you are paying for ads, you need to know what is and isn't working. You need to know your ROI. So this needs to be correct.
The most common problem is that the traffic isn't being tagged properly. Google Analytics uses UTM to track what specific traffic comes from (mostly). That means that the URL needs to have certain bits of information in it. You either need to manually create URLs that have the proper tags in them, or let your advertising platform automatically create those URLs when you run ads. If you want to create them manually, here is Google's Campaign URL builder. Just remember to use naming/tagging conventions that make sense. You don't want to go into Google Analytics to see what ads got results, and be unable to read the report because you tagged them with odd numbers or names that don't make sense.
Email traffic showing up as direct- Exact same thing. This is caused by not having the correct tags in a URL in a marketing email. Either manually or automatically (using your email marketing software) tag your traffic so that Google Analytics knows it is coming from email instead of someone typing it into the address bar.
Social media traffic showing up as referral or other- This is a slightly different beast, because it's something where GA is just kind of broken. It doesn't recognize the way that a lot of social traffic is tagged. That means it's not a tagging issue so much, and we can fix it inside GA settings with a filter. It's slightly technical and will take about 10 minutes, but once it's fixed, it's fixed. I will note that this is not the only problem with GA reporting on social and referral traffic, but it is a big one, and this is a step on the way to better data.
We're going to create a filter that takes social traffic -which could be misattributed- and sends to it the right place in our reporting. This is going to take two filters that are almost exactly the same, just because of a limit on how many characters you can type into one of these boxes. I'll show you how to do that:
First, go to Google Analytics—> Admin—> View (Choose the view you want to create the filter in, preferably your "Master" view)—> Filters. Click the red "+Add Filter" button
- Create a new filter
- Name it Rewrite Medium to Social Part 1
- Select "Custom" as filter type
- Select "Advanced" in the drop down
- For Field A, select Campaign Source, and then paste this:
youtube|wikipedia|stumbleupon|netvibes|groups\.google|bloglines| groups\.yahoo|linkedin|facebook|webmasterworld|del\.icio\.us|digg|fe edburner|twitter|technorati|blog|faves\.com|wordpress|newsgator|prwe b|econsultancy|toprankblog|forums\.searchenginewatch
- For Field B, select Campaign Medium, and then paste this:
- For Output To, paste this
For the second filter, every thing is the same, except this:
- Name the filter Rewrite Medium to Social Part 2
- In the Field A box, paste this:
6. Turn on Enhanced Ecommerce
That last one was difficult. Ready for an easy, high-impact change? Good. We're going to bring a bunch of valueable ecommerce data into your Google Analytics reporting with one checkbox in Shopify, and one in Google Analytics.
In GA, go to Admin—> View (Again, pick the view you want to use, you can actually just turn this on in every view, including the unfiltered/backup view) —> Ecommerce Settings.
Then turn on both switches you see there and hit save. Don't worry about Checkout labeling right now.
In Shopify, go back to where you pasted your Google Analytics code in the backend: Online Store —> Preferences—> Google Analytics. Check the "Use Enhanced Ecommerce" box.
Now you're done. Rejoice. That one was super easy.
7. Set up some referral exclusions
So, traffic may be bouncing back and forth between your payment gateways and your site. If that's happening, each time it is counted as new visit. So when your customer comes back with the completed purchase, that is separated from what came before it. As far as GA is concerned, PayPal or GooglePay was responsible for that sale. So we are going to fix that.
In Google Analytics, navigate to Admin > Property >Tracking Info>Referral Exclusion List. Click the red "+Add Referral Exclusion" button. In the box that appears, you will want to enter (one domain at a time) any possible referrers that you don't want getting credit for traffic. Leave off the http:// and www.
Clean up your data
The first step to making more money using data is to make sure your data is accurate. You have to be able to trust your data before you can use it to make decisions.
If you want help making sure you have reliable data, get in touch with me here.
If you want to learn more about using data to improve your Shopify store, feel free to check out Data-driven Decision Making for Shopify Stores.