Collect data with Google Analytics

Google Analytics is a service that lets website and shop operators view more detailed statistics regarding the use of their website or shop, for example frequently accessed pages, or the origin of their customers. Thus, Google Analytics can help you to better understand the behaviour and the needs of your customers so that you can optimise your shop accordingly.

How to use Google Analytics for your shop

To use Google Analytics for your shop you'll only need to connect your fully set-up Google Analytics 4 account to your shop. You need to do that via a so-called Google Tag in your Google Tag Manager account.

In order to use the functionality of Google Analytics, your shop must have its own domain.

Caution

Check whether the use of Google Analytics is permitted by data privacy laws in your country and if there are any conditions for using this service.

For example, you might need to update your privacy policy to inform your customers about the use of Google Analytics. For further information about editing your privacy policy, refer to the article Edit legal pages. For further information about the requirements regarding customer data and privacy policy when using Google Analytics, refer to the article Analytics policies.

How to set up Google Analytics

Before you can activate Google Analytics for your shop, you need to set it up.

If you already have a Google Analytics account, make sure that it is a Google Analytics 4 account! In 2020, Google introduced Google Analytics 4 (also known as GA4) which replaced Google Universal Analytics (UA) on July 1, 2023. For further information on how to check whether you use Universal Analytics or Google Analytics 4, refer to the Google Analytics Help.

If your account is not a Google Analytics 4 account, you need to migrate your account first! For further information regarding the migration, refer to the instructions in the Google Analytics Help.

This is how you set up Google Analytics 4:

For further information regarding these steps, also refer to the instructions in the Google Analytics Help.

  1. Open Google Analytics.
  2. Sign in to your Google Analytics 4 account or create a new one.
  3. Create a Google Analytics 4 property.
  4. Add a data stream. Make sure to select the platform Web.

You have set up Google Analytics.

Before the tracking can start, you need to connect your shop to Google Analytics by creating a Google Tag in your Google Tag Manager account.

How to connect Google Analytics and your shop

There are multiple ways to connect Google Analytics, but for your shop you'll need to use the Google Tag Manager. The complete workflow is also described in the Google Tag Manager Help.

Before connecting your shop make sure that you:

The thing that connects your shop, Google Analytics, and the Google Tag Manager is the so-called Google Tag. This tag establishes the data flow from your website to Google Analytics.

In Google Tag Manager, tags fire based on events, such as when a form is submitted or when a video is played. Triggers are used to listen for these events, and they govern when a tag is fired or blocked. This also applies to the Google Tag.

To connect Google Analytics to your shop, all you need to do is create a Google Tag and make the settings for its triggering.

Create Google Tag

  1. Open the Google Tag Manager.
  2. Sign in to your Google Tag Manager account.
  3. Select the container for your shop.
  4. Open the menu Tags.
  5. Select New to create a tag.
  6. Enter a name for the tag at the top (e.g., "Google tag configuration - example.com").
  7. Select Google Tag in the box Tag Configuration.
  8. Enter the Measurement ID of the data stream you want to use for your shop in the field Tag ID. You can find this ID in the data stream settings in your Google Analytics account. For further information, refer to the Google Analytics Help.
  9. Optionally, configure your tag by making additional settings. For further information, refer to the Google Tag Manager Help.

Set trigger

  1. Select the box Triggering to choose a trigger.
  2. Use the trigger Initialization - All pages trigger to ensure that the Google tag fires before other triggers.

    Info

    There are multiple options and you can also configure a fully customised trigger. For further information, refer to the Google Tag Manager Help.
  3. Select Save.

You have created a Google Tag and set the firing triggers. The Google Tag will now be displayed in the menu Tags in your Google Tag Manager account.

To edit the settings again, select the name of your Google Tag.

How to submit your Google Tag

Before your Google tag starts to send information to Google Analytics, you'll need to submit it. Before doing so it is recommended to verify that your tag works as expected as described in the section below.

Verify your tag works

  1. Open the Google Tag Manager.
  2. Sign in to your Google Tag Manager account.
  3. Select the container for your shop
  4. Select Preview in the top bar.
    The Tag Assistant opens in a new tab.
  5. Enter the URL of your shop.
  6. Select Connect.
    Your shop will be opened in debug mode in a new tab.

    Caution

    Don't close the tab with your shop and make sure that you accept or have accepted all cookies for your shop. Otherwise, the connection of your Google Tag to your shop might not work.
  7. Check if your Google Tag fired:
  8. When you are done, return to your container in the Google Tag Manager.

Publish your changes

  1. Select Submit in the top bar to publish your changes.
  2. Make the respective settings for the new version of your container. For further information, refer to the Google Tag Manager Help.
  3. Confirm your settings by selecting Publish.

You have submitted your Google Tag. Your Google Analytics account should now start to collect data for your shop.

Caution

Your customers can decide to only accept the required cookies when being prompted to the cookie notice. In that case, the tracking of Google Analytics is automatically disabled and the respective analytics will not include data from these customers.

How to customise which data is collected for your shop

The collection of data for your shop via Google Analytics is based on so-called Events. An event allows you to measure a specific action or behavior in your shop. For example, you can use an event to measure when someone loads a page, selects a link or completes a purchase.

For some of these situations, Google has already set up an event, but for others you may need to set up recommended or custom events. For further information, refer to the Google Tag Manager Help.

Was this article helpful?