DE

EN

Blog Post

Web analytics

Thorsten

Abrahamczik

published on:

Google Analytics Basic Configuration – What You Should Know

Table of Contents

No table of contents available

In our last article on web analytics, “The best tools for a successful start in web analytics”, we already covered tools that help you set up Google Analytics. As a next step, we would like to explain what the basic setup of a modern Google Analytics implementation should look like.

In our day-to-day work, we often see Google Analytics set up incompletely or even incorrectly. And in cases where it is properly integrated, it's rarely used—or not used at all. This usually comes down to two reasons:

  1. The online marketing manager isn't sure whether tracking is properly set up and whether they can trust the numbers.

  2. The online marketing manager doesn't have time for reporting or finds the tool too complex.

With this article, we want to address the first potential issue. In this brief guide, we’ll show you how to properly implement and use Google Analytics on your website without any errors. In addition, we'll give you a tip on how you can largely secure your data quality using a spam filter. Eoghan Henn wrote an article on this topic. The requirements for this setup are a Google Tag Manager account and one-time access to your site's source code. We've already explained what the Tag Manager is in our article “Centrally manage your online marketing tags with Google Tag Manager”.

Create an Account, Property, and View in Google Analytics

Check if a Google Analytics account already exists for your company. If not, please set up an account and a property in Google Analytics. To configure it in Google Tag Manager, you will need a Google Analytics UA ID, so this step must be completed first.

Each property should have the following three views:

  1. Live Environment,

  2. Test Environment, and

  3. Raw Data.

To do this, go to your “Default” view and click the “Admin” button at the top. From there, you can click on the drop-down menu on the right and select “Create view”. The Raw Data view should not contain any filters that alter or exclude specific data. Please keep in mind that internal search queries can also flow into the raw data (if internal search is available on the site). The “Live Environment” and “Test Environment” views must always be configured identically. Later on, the test environment will be used to test new elements like filters in advance. This allows you to check them in the test environment before applying them to the live environment. That way, you ensure that the data in your Google Analytics live environment is always accurate.

At the property level, you now need to set up a “Custom Dimension” under “Admin” -> “Custom Definitions”. This will later be used to block spam arriving in Google Analytics via the Measurement Protocol. Please take note of the corresponding index number. It’s important that the status of the new dimension is set to “Active”. Enter the following details:

  • Name: Exclude Ghost Referral Traffic

  • Scope: Hit

  • Active: Checkbox is checked

Next, you need to create a filter in each view. This will ensure that Google Analytics only accepts metrics that have been verified with a “password protection.” This keeps your metrics in Google Analytics largely spam-free. Once created, the filter can easily be applied to other views using “Apply existing filter.” To do this, go to “Admin” -> “Filters”. The filter requires the following settings:

  • Filter Name: Exclude Ghost Referral Traffic

  • Filter Type: “Custom” -> “Include” -> “Exclude Ghost Referral Traffic”

  • Filter Pattern: “Exclude Ghost Referral Traffic”

Google Analytics Filter

Finally, a second filter should be created in each view to standardize URLs. This may reduce the number of unique URLs in Google Analytics, but it improves the quality of your metrics. Imagine having two identical URLs, one of which contains uppercase characters. This filter ensures that all URLs in Google Analytics are always lowercase. As a result, you’ll only have one URL in Google Analytics aggregating the metrics of both pages, making your reporting much easier. Configure the filter with the following settings:

  • Filter Name: Standardize URLs

  • Filter Type: “Custom” -> “Lowercase”

  • Filter Field: “Request URI”

Next, set the filter order as follows:

  1. Exclude Ghost Referral Traffic

  2. Standardize URLs

Set up Google Tag Manager

Sign in to Google Tag Manager using your Google Analytics account credentials. If you don't have an account for your website yet, you can easily create one. Please note that an account is always assigned at the company level, meaning you only need one Google Tag Manager account for your business.

Once that's done, you need to create and configure a container. Generally, one container is created per domain, and the URL of the respective domain is used as the container name, e.g., “www.internetwarriors.de”. Then, select “Web” as the target platform. Once you've done this, the container code snippet will be displayed automatically. Copy this code and insert it into the source code of ALL pages on your domain. The script must be placed directly after the opening <body> tag.

Set up the Google Analytics Universal Tag in Google Tag Manager

To use the Universal Analytics tag correctly, you need two variables, which you can create in Google Tag Manager under “Variables”:

  1. The first variable is set up as a “Constant”. Name it “Constant - GA UA Number”. The value of the variable is the UA ID of the property you just set up, e.g., “UA-123456-1”. This variable makes it super easy to update the UA ID across all used tags later by just changing this one value.

  2. The second variable also needs to be set up as a “Constant”. Name it “Constant - Exclude Ghost Referral Traffic”. For the variable value, you can use something like “This is a great password”. This variable will be used down the line to block spam traffic in Google Analytics. Now, create the Google Analytics Universal Tag, which provides the Google Analytics tracking functionality. Use the following settings:

  • Choose Product: Google Analytics

  • Choose Tag Type: Universal Analytics

  • Configure Tag: Tracking ID: Use the “+” plus button to select the variable “Constant - GA UA Number”. Important: there must only be two curly brackets before and after the words. If there are more or fewer, it won't work.

  • Enable Display Advertising Features: Checkbox is checked (This only needs to be done in this tag and is not necessary for any other tags.)

  • Track Type: Page View

  • Fields to Set: Field Name: “anonymizeIp”; Value “true”

  • Custom Dimensions: Index: “1” (This can also be a different number, depending on the index number you received when you created the custom dimension in Google Analytics. These two numbers must match.); Dimension Value: Click the “+” plus icon to select the variable “Constant - Exclude Ghost Referral Traffic”. Important: there must only be two curly brackets before and after the words. If there are more or fewer, it won't work.

  • Advanced Configuration: Set “Enable Enhanced Link Attribution” to “True”

  • Fire On: “All Pages”

  • Save Tag

After creating the tag, you can test the setup in Preview mode. To do this, click the arrow next to the “Submit” button in the top right and select “Preview”. Next, visit your website, and you will see the debug console at the bottom of your browser window. It will show you whether the Universal Analytics tag you just created is firing correctly. If it is, check the Real-Time report in Google Analytics to verify that your visits are appearing properly. Once everything works, you can publish the tag in Google Tag Manager by clicking the “Submit” button.

Google Tag Manager

Exclude your own traffic and, if possible, client traffic by IP address

You may want to exclude your own visits to the website from Google Analytics tracking. In this case, go back to “Admin” -> “Filters” and set up a new filter. Always use only the first three octets of your IP address, since filtering by all four octets doesn't work due to IP anonymization. It’s also important that your company has a static IP address. If this isn't the case, there are alternative options, though we won't cover them here.

Now create the following filter in every view except “Raw Data”. Feel free to adjust the filter name to fit your company.

  • Filter Name: Exclude itw IP address range

  • Filter Type: “Predefined” -> “Exclude” -> “traffic from the IP addresses” -> “that begin with”

  • IP address: “111.11.111” (enter the first three octets—the blocks of numbers separated by periods—of your IP address here).

Privacy & IP Anonymization

You can find full information on data privacy in Google Analytics on the portal (LINK to: httpss://www.datenschutzbeauftragter-info.de/fachbeitraege/google-analytics-datenschutzkonform-einsetzen/) datenschutzbeauftragter-info.de. Please remember that you must use the UA ID of your Google Analytics property when using the opt-out cookie script. This is a common mistake that is easily overlooked and renders the opt-out cookie completely ineffective. Additionally, you need to make sure that the opt-out cookie can be properly set and checked on your privacy policy page. Afterward, you can also verify this in the Google Analytics Real-Time report—provided you haven't already excluded your IP address. If you have, you'll need to temporarily remove that filter.

How we can help you

Not quite sure if your Google Analytics setup was implemented correctly, or feeling a bit overwhelmed by these instructions? Feel free to get in touch with us. We'd love to discuss the possibilities of web analytics with you, review your setup, and make adjustments as needed. We can also provide ongoing web analytics support to help you derive actionable insights for your individual online marketing channels and generate more leads over the long term.

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter

Address

Bülowstraße 66

Aufgang D3

10783 Berlin

Legal Information

Newsletter