Instructions: Setting Up Google Analytics for Website & Shopify

Nils Martens 10/19/2022

We show you how you can set up Google Analytics in 5 steps to be GDPR compliant

Google-Analytics einrichten
Table of contents
  1. What is Google Analytics?
  2. How to set up Google Analytics for your website in 5 steps
  3. What you need to keep in mind to set up Google Analytics DSGVO compliant
  4. Setting up Google Analytics for Shopify? It's simple!
  5. Conclusion

We'll tell you how to track your website or webshop traffic with Google Analytics while ensuring ePrivacy safety

Instagram, LinkedIn, TikTok, YouTube – all wonderful platforms for marketing your company and attracting your target audience. But among all the modern possibilities, do not forget your website. In particular, SEO (Search Engine Optimization) is one of the most important measures to attract people to your website. Users ask their questions on Google, the most used search engine, and expect answers. Do you want to be the answer to certain questions? Then brush up on your SEO skills or hire an expert for it and use helpful SEO tools.

Furthermore, you should always keep an eye on your statistics and regularly conduct a Content Audit: number of daily visitors, where on your website do users feel most comfortable, where do they leave and all other data that reveal more about the performance of your website.

For this, there is the brilliant tool Google Analytics, which in connection with the Google Tag Manager provides valuable insights. Google's website analysis tool is free and tells you everything about your website if you set it up correctly.

We explain exactly how to do this step by step in this article. Without having to google the questions, we also give you answers to what Google Analytics is, how you can use the tool in compliance with the DSGVO and how you can even set up Google's SaaS for Shopify.

Table of Contents

1. What is Google Analytics?

2. How to set up Google Analytics for your website in 5 steps

3. What you must keep in mind to set up Google Analytics in compliance with DSGVO

4. Setting up Google Analytics for Shopify? It's simple!

 

What is Google Analytics?

Web analytics programs are there to give you an overview of all your website data and statistics. In our opinion, Google Analytics is the best and cheapest choice, but far from the only one. Simply compare other web analytics tools on OMR Reviews based on different user experiences and find the best tool for your company.

Meanwhile, Google Analytics can show you the following:

  • The performance of your content
  • Real-time values
  • The daily traffic on all pages
  • Performance of your marketing activities
  • The detailed behavior of your visitors
  • Demographic details
  • Interaction gradations after encountering the users on your homepage
  • The loading speeds of your website and pages (speed is the key!)
  • Everything about the sources of website visits
  • Number of target efforts (= conversions)

These are the core competencies of Google Analytics. However, there are many more functions and interfaces to other Google products like Google Search Console or Google Ad Manager.

What Google Analytics is used for depends on what you want to find out. Just because you run a website doesn't mean you're interested in all the numbers and features Google prepares for you. If you have a landing page with the aim of generating leads, you will ask yourself different questions about its success than if you have a website that represents your company.

However, for all projects, Google Analytics shows you in various reports exactly what you can do better to attract even more visitors and transform them into customers and enthusiastic people.

How to set up Google Analytics for your website in 5 steps

The first steps to set up Google Analytics for your company and your website or online shop are done in minutes. It becomes trickier when you start using the individual areas and reports of the tracking tool. We show you how you can set up Google Analytics without needing deep programming skills.

Step 1: Create a Google Analytics account

First comes the sign-in. To use Google products, you need a Google account. You can create this very simply by choosing an email address with a “gmail.com” ending and setting a password – just like any other registration. Now, you need to create an account on Google Analytics. Go to analytics.google.com and click on the blue button that jumps out at you.

Give the account a name – for example, the name of your website, your shop, or your brand. Leave all the checkboxes checked or deselect any that imply different data consent under the name field. We recommend you leave everything as is and click “Next”.

Google Analytics Konto erstellen

First, create a Google Analytics account.

Step 2: Set up a Google Analytics property

In the next step, you'll be asked what you want to measure: website, app (iOS/Android), or app and website. In our instructions for setting up Google Analytics, we'll show you how to set it up for a website.

For perfect analysis, Google needs information about your property. Besides the name, the main thing to do here is to reveal the domain that should be tracked. Your industry and your time zone are also relevant pieces of information. After that, you'll get your tracking ID, which always starts with UA. How you can integrate this into your website code, we reveal in the next step.

Google Analytics Property einrichten

Set up a property to track your website or app.

Step 3: Connect Google Analytics Tracking ID

So that Google Analytics can track your website data, you can go two ways. We recommend from the start to work with the Google Tag Manager, as you will have less effort afterward. For example, you only have to add the tracking code to the source code of your website once. Also, Google keeps emphasizing that the combination of Google Analytics and Google Tag Manager is the future of tracking.

Google Analytics Tracking-ID

This is what a tracking ID looks like, which you can find in the management area of your Google Analytics account.

With Google Tag Manager

You can also use the tag manager with your Google account. However, you also have to create an account here, where you enter your project name and the medium to be tracked. The latter is called a container in Google Tag Manager. You will then be presented with the tracking code. It is split for <head> and <body>, which is why you must also integrate the two code snippets in both corresponding places on each page of your website. Depending on which Content Management System (CMS) you use, you'll find the source code of your website in different places. If you are setting up tracking for WordPress you insert the code snippets in the header.php.

Without Google Tag Manager

If you want to forego using the Google Tag Manager for simplicity's sake, you will also get a tracking code in Google Analytics. You then embed this in the header.php. Simple as that: For WordPress, use the Google Analytics dashboard plugin from MonsterInsights. This especially helps beginners in implementing the code snippet into your website code. With the free plugin, you can view your insights both on the WordPress dashboard itself and in Google Analytics reports.

The tracking code is inserted, now the fun of analysis can begin.

Step 4: Set up data view in Google Analytics

Since Google Analytics has many different areas and reports that reveal important figures to you, there is quite a bit to set up to design or understand your data view appropriately. It all starts in the home area. Under “All Web Site Data,” you will find all the properties you have created.

Homepage aka Home Area

On the homepage, you will find an overview of the most important statistics like the number of users, bounce rate, session duration, and active users in real-time. Additionally, you get a superficial insight into how users come to you, what country they are from, at what times your website is frequented, or what pages are most popular.

The values on the homepage by default refer to the last 7 or 30 days, which you can adjust. You can click on each report to get more detailed insights, or you can turn your attention directly to the reports in the left menu column:

Google Analytics Startseite

The Home Area aka the homepage in Google Analytics using a real example.

Real Time

Under this, you’ll see what's happening on your website right now. This also includes data corresponding to your target plans, but above all the location and source of your real-time traffic. It also informs you about the content that is currently being viewed and which is trending. However, it becomes especially interesting in the next three report areas, as they give you insight into how you can optimize your website.

Audience – Who and how many users visit your page

On the audience report's overview page, you can adjust the time span in which you want to view your traffic. Following this, you will see various statistics in numbers and diagrams. This includes the number of users, the number of sessions, and the average session duration in the selected period.

The next setting you can make is comparing two periods. To do this, go to the date field at the top right again and activate the tick at “Compare with:”. Now you choose the second period and can subsequently see in percentages how the performance of your website has improved or deteriorated.

Here, Google Analytics gives you the first clues on a silver platter about what could have caused the changes and possibly needs optimizing. The more green percentages, the better! So let your inner Sherlock Holmes out and analyze what you're seeing. Both periods remain current, even if you leave the overview page and switch to “Interests”, for example.

You can add more comparison parameters by adding additional segments at the top. To do this, click on “+ Add segment” and then choose the desired segment. Now you can see, for example, how the number of new users compares to all users in the period.

If you're hosting an English-language website for an international audience, the “Geography” point is relevant for you. There, you can determine the languages and locations of your users and adjust your Content and Marketing Strategy accordingly to attract more users from the trending regions, for example, through targeted Ads campaigns.

To get details for countries, select the particular country. Of course, you can also use this for a German-language website to find out from which German or Austrian federal states or Swiss cantons your visitors are coming from. You can find similarly exciting information behind the “Demographics” tab, but you have to activate this tracking first.

You have now made all settings regarding your audience. You can now analyze your data in peace, or continue with the setting options in the next two reports.

Acquisition – How do users get to your website

This is the place where you find out where your visitors are coming from. In most cases, they have an organic origin. If you've been in business for a long time, the number of people who come directly to you by entering your URL in the browser will also increase. Social media and paid marketing are two further origins.

There are few settings to be made in Acquisition. However, in this area you have many options to click on areas to learn details. You can also link your Google Ad account as well as the Google Search Console.

The only place where there is something to adjust is “Social Networks”. To find out, for example, how your content strategy on Instagram in terms of website clicks develops, you have to set up so-called target plans in Google Analytics. You can find out exactly how to do this under fifths.

Behavior - What do users do on your website

You now know how to track how many users come to your website and how they do it. The question remains, what do users like to do most on your website? Under “Website content” you can see where the visitors stay the most and where they leave your page the most.

Since the Core Web Vitals have taken on a decisive importance for your site and SEO in the spring of 2021, you have to keep an eye on them. It is therefore important for the Google algorithm that you can show fast page loading speeds - on all of your pages. Fortunately, Google Analytics measures this for you.

Under Publisher you can finally check the monetization of your website. However, you must first link Google Analytics and AdSense or Ad-Exchange. Simply go to “Get Started”, and then you will be guided through the process.

Extra tip – Create multiple data views

In Google Analytics, you can also created multiple data views for different use cases, for example to have a completely unedited/unfiltered data view or to use a data view for testing purposes.

For this, you go to the administration of your Google Analytics account – there you will see three columns with different setting options: account, property, and view. In the right column View you will find a blue button "+ Create data view". Through this button, you can create additional Google Analytics data views for yourself.

Step 5: Set up Conversions

For online shop and website operators, it is most important to earn money. Understandable. To find out how website visitors become real customers, you create Conversions, which are called Target Goals in Google Analytics. To do this, go to your Google Analytics administration and click on Target Goals in the right column of the data views. A new window opens where you click on the “New Target Goal” button and set up your target goal in three steps: setting up the goal, goal description, and target goal details.

Once it is created, Google tracks from then on to what extent you are reaching your target goals. Your task is now to initiate suitable measures that lead to the desired result: making a profit! Google Analytics even provides a funnel for visualization.

For the online shoppers among you, there is the “E-Commerce” point, which shows you how product sales, purchase amounts, and locations of the buyers are. However, you first need to activate e-commerce tracking. This is possible under “Administration”, "Data View" and “E-Commerce Settings”. This results in another code snippet that you anchor in the code of your online shop.

So, you have also set up the Google Analytics Conversion Tracking. In the guest post “Tips for Google Analytics Setup” by Maria-Lena Matysik, you can learn more about targeted tracking with Google Analytics. Before you turn to the measures to increase traffic, you should design the tracking to be DSGVO compliant.

What you need to keep in mind to set up Google Analytics DSGVO compliant

Setting up Tracking Opt-Outs

Every marketer's back will run cold at the mention of the term “Opt-Out”, since digital data is as valuable as the green paper itself. However, so that your visitors can exclude themselves from being tracked by Google Analytics, Google allows them to install a Browser Add-on for deactivating Google Analytics in their browser. This works equally for Chrome, Firefox, Edge, and Safari.

For the add-on to be able to do its job, you first need to copy, adjust, and also insert a code into header.php. However, before the actual Google Analytics code. This is again followed by a catchy pop-up message, which informs the users about the deactivation. Replace UA-XXXXXXX with your Google Analytics tracking ID.

<script>
var gaProperty = ‚UA-XXXXXXX-X‘;
var disableStr = ‚ga-disable-‚ + gaProperty;
if (document.cookie.indexOf(disableStr + ‚=true‘) > -1) {
window[disableStr] = true;
}
function gaOptout() {
document.cookie = disableStr + ‚=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/‘;
window[disableStr] = true;
}
</script>

<a href=“javascript:gaOptout();“ onclick=“alert(‚Google Analytics has been disabled‘);“>Disable data collection by Google Analytics for this website</a>

This procedure is only necessary with content management systems like WordPress. If you use a homepage construction kit, most providers offer options that make the establishment of opt-outs simple.

Website Cookie Consent Tool

Following, we will explain based on WordPress and the Cookie Consent Tool Borlabs Cookie this important tracking component. Such a Cookie Consent Tool ensures that your website can always be visited DSGVO-compliant. A Consent Management Software therefore informs users about tracking and holds the option open to them to accept cookies and other tracking technologies individually or completely. Borlabs Cookie therefore takes care of professional and above all DSGVO-safe opt-ins. With this, you cover the ePrivacy topic comprehensively for your WordPress website.

Borlabs Cookie

With the WordPress plugin Borlabs Cookie, you can track in compliance with the DSGVO.

Little tip: Borlabs Cookie is of course not the only one of its kind. You can find additional Consent Management Tools on OMR Reviews. There, you can compare and find the best Cookie Consent Tool for you based on verified user experiences. On the other hand, we also present you the best WordPress Cookie plugins in this article.

IP Anonymization

Another work step you must take is IP anonymization. So that the IP of your users is not tracked, you can arrange for Google Analytics to implement this for every website visitor. However, there is a difference: If you use Google Analytics 4, you don't have to do anything, as it is preset. If you use Universal Analytics, you have to take action manually (Difference between Universal Analytics and Google Analytics 4). Specifically, this means: another code snippet is required:

gtag(‚config‘, ‚ UA-XXXXXXX ‘, { ‚anonymize_ip‘: true } )

You also insert this in header.php before the actual snippet. A detailed Guide to IP anonymization by Google is available here.

Setting up Google Analytics for Shopify? It's simple!

You want to set up Google Analytics with the Shop System from Shopify? In this case, setting up Google Analytics is child's play compared to the previous instructions. The next three steps will help you:

1. Ensure that Google Analytics has not already been activated

If Google Analytics is already activated in Shopify, it can lead to incorrect data. And you really don't need that. If you, for example, take over an existing Shopify shop, a tracking may already have been implemented. So check under “Configurations” to see if a code already exists in the “Google Analytics” section, starting with UA. If not, continue with step two. Otherwise, you have to see if it is your ID. If yes, you only need to perform step three.

2. Properly set up property

After you have created a Google Analytics account (as described above), you have to set up the property correctly. Very important: It must be a Universal Analytics property. Otherwise, the tracking for your Shopify shop won't work. So create a property, as we have already described above under step two. However, select the box “Create only a Universal Analytics property”. By default, a Google Analytics 4 property is created. Copy the subsequent code and paste it into the configuration area of your Shopify dashboard in the “Google Analytics” section. So far, you have already done half the work. To complete the setup, you have to activate the tracking.

3. Activate E-Commerce-Tracking

Shopify distinguishes between simple and advanced e-commerce tracking:

  • Simple E-Commerce Tracking = Captures all your transaction and revenue data
  • Advanced E-Commerce Tracking = Additionally captures visitor behavior in your online shop

In our opinion, the simple tracking is enough, as you can see the numbers from the extended e-commerce tracking directly in your Google Analytics account. But if you want to see all the numbers in Shopify, the Shopify Help Center can help.

This is how the activation of the simple E-Commerce Tracking works: First, you digitally go to the admin area of Shopify. There you will find the “E-Commerce Settings”. You then turn the toggle switch to “ON” to activate the e-commerce tracking. Have some patience until the numbers become available.

If you want to dive even deeper into the topic, our guest author Nick Hartmann has written a separate article about how to connect Shopify with Google Analytics and thus improve your shop's performance.

Conclusion

Ultimately, setting up Google Analytics is quite simple. It might be trickier to insert individual code sections for DSGVO-compliant tracking. We hope our guide has made it much easier for you to get started with Google Analytics, so that successful tracking results can be achieved.

If you're looking for an alternative to Google Analytics, you can find many more website analysis tools on OMR Reviews. In addition, in another article, we reveal the seven best website analysis tools. Just follow the link.

Nils Martens
Author
Nils Martens

Nils ist Gründer der Personal Branding Rebels und bereits einige Jahre im LinkedIn-Game unterwegs. Zusammen mit seinem Team unterstützt er Menschen und Unternehmen dabei, auf der Business-Plattform sowie darüber hinaus sichtbar zu werden. Die Rebels bilden dafür Mitarbeitende zu Corporate Influencern aus, übernehmen den Aufbau kompletter Personal Brands und educaten in Workshops.

All Articles of Nils Martens

Software mentioned in the article

Product categories mentioned in the article

Related articles

Join the OMR Reviews community to not miss any news and specials around the software seeking landscape.