How to connect Google analytics

Register Google Analytics 4

Go to https://analytics.google.com/analytics/web/ and click the "Create Account" button.

Name the account as the website domain without protocol and slash and click "Next".

Создание аккаунте

We add GA4 to the name of the resource to distinguish the resource from Universal Analytics. Then we select the country, time zone in which the site operates, as well as the currency of the site.

Настройки сайта

If you want to track data in Google Analytics 4 and Universal Analytics side by side, click "Show advanced options", turn on the radio button, name the resource with the domain name and select "Create two types of resource: Google Analytics 4 and Universal Analytics".

выбор типа ресурса

Here you can also choose to create only the Universal Analytics resource.Выбор типа ресурса

Select "Hide advanced options" and the "Next" button. We select the desired industry category, for example, "Purchases" for an online store. Next, we specify the size of the company, mark all the options for use and click the "Create" button.

Опции использования сайта

Then you need to select the country again and agree to the terms of use of the analytics service.

Соглашение с условиями использования GA4

A new Google Analytics 4 account has been registered, now let's start setting it up.
To create a new resource for a site on which Universal Analytics is installed, you need to go to the "Administrator" panel, in the "Resource" column, click on "Upgrade to GA4", and then the button - "Get Started" and "Create a resource".

Setting up a Google Analytics resource 4

Go to "Data Streams" and click "Web".

Потоки данных

Enter the site URL, name the stream, turn on advanced statistics (if it is disabled), double-check that everything is included in "Enhanced statistics:", and click "Create stream".

Создание потока

After creating the flow, the indicator ID will appear, you need to copy it by clicking on the copy icon. Since I will be adding code to the site through the Google Tag Manager already installed on the site, I click "Use an existing tag on the page" and follow the instructions from the interface.

Сведения о потоке

Installing Google Analytics 4

Go to https://tagmanager.google.com/, to the "Tags" section and click "Create".

Создание тега для GA4 в GTM

Name the tag, click on the tag configuration and select "Google Analytics: GA 4 configuration".

Выбор конфигурации тега

Paste the indicator ID copied in Google Analytics 4.

Добавление идентификатора

Click on the activation trigger, select "All Pages" and save.

Все страницы

Once a tag has been created, it must be submitted and published.

Отправка тега на сайт

Публикация

When publishing a container, you need to enter a description of the version, you can skip this step

Описание версии

Data collection

Let's go to Analytics. In the admin panel, click "Data collection", activate Google signals (collection of interaction data and remarketing across devices) and press three buttons in sequence: "Start", "Continue" and "Activate".

Настройка сбора данных шаг 1

Настройка сбора данных шаг 2

Настройка сбора данных шаг 3

Check if the slider is lit, indicating the activation of the collection of Google signals, and click "I confirm".

Сбор данных - активация

We agree to the collection of user data.

Сбор данных

Data storage

In the "Administrator" panel, select the "Data storage" tab and set the maximum allowed period to 14 months. Save.

Параметры хранения данных

In the "Default Report ID" tab, select the method by which we will identify users, and click "Save".

Хранение данных - тип

It is better to set up a connection with Google Ads in your advertising account so that you do not forget to enable automatic link tagging when creating a new Google Ads account. If your Google Ads account has already been linked to a Universal Analytics property, then the link to Google Analytics 4 will be established automatically, but audiences and conversions must be imported separately.

Связь с Google Ads

 

Conversion settings

When creating GA4, all conversions will have to be reconfigured. To set up the conversion - for example, let's take a look at the transition to the cart page - go to the Tag Manager, create a tag, name it and select "Google Analytics: GA 4 event" in the configuration.

Настройка нового события в GTM

In the drop-down window "Configuration tag" select the tag created earlier. We call the event in Latin characters, I called it go_basket.

Тег

Add an activation trigger through the plus in the upper right corner.

Триггер активации

We name the trigger, click on the settings, select the type "Page View".

Тип триггера Просмотр страницы

 

Then the actions are:

  1. Set the toggle to "Some pageviews".
  2. Select the Page URL value from the drop-down list.
  3. Click on the next dropdown list.
  4. Select "starts with".
  5. Set the expression /basket.
  6. Click "Save".

Настройка события

We save the tag, send it and publish it. The description can be skipped.Публикация события на сайте

Go to the Tag Manager workspace and turn on the preview, enter the site in the field, click Continue and in the next tab go to the site in debugger mode (the debugger adds ?gtm_debug=x to the site URL, for example, https://your-sait.com /?gtm_debug=x) and go to the cart page. Our event should fire.
If everything is set up correctly, then in Analytics, after a while, the go_basket.*** event will be displayed in the "Real-time Report" tab.
Отчет в режиме реального времени

To make this event a target, go to events, find the one you need and set the switch to on.

Настройка цели

The conversion will now show up in the Conversions section within 1-2 days.

Конвесрия в отчете

Audiences

After setting up conversions, we proceed to setting up the audience through the admin panel or through the "Audiences" report. In the admin panel, select the "Setup Assistant" tab and in "Audiences" click on "Define Audiences".

Настройка аудитории шаг 1

By default, two audiences are created: "All Users" and "Customers". But the latter won't work until ecommerce is set up for the Google property.
Analytics 4.

Две аудитории по умолчанию

We create a new audience that will collect users who have made a conversion - click "New Audience". Then click "Create a custom audience".

Создание особой аудитории

We give the audience a name and define the event we need.

Настройка цели - выбор события

Select the event_count parameter.

выбор типа цели

In the "Condition" field, set more than 0, in the "Time period" - 7 days (we focus on the deal cycle) and click "Apply".

Настройка цели

We set the data storage period, look at the size of the audience in the summary. If you just created a goal, then there will be no data in the summary and the size of the audience should be rechecked in 1-2 days. Save.

Отчет

This completes the basic setup. We figured out why you should switch to Google Analytics 4, how to register it, install it, and how to set up simple conversions and audiences.

To connect Google Analytics to your website, go to the "Promotion" - "SEO Settings" - "Google Analytics" tab and add this identifier in the "Google Analytics ID (Measurement ID)" field.

Additionally, you need to fill in the "Google Analytics Secret (API)" field. This value can be taken or generated in the data stream settings in the same window where the Measurement ID is located: Settings - Data Streams - Your Project Name - Measurement Protocol API Secrets. On this page, you must confirm the user agreement, after which the "Create" button will be unlocked. After clicking it, enter a random name and click "Create" again. After creating the API Secret, you need to copy the "Secret value" and paste it into the "Google Analytics Secret (API)" field in the admin panel.

Where can I find my Google Analytics ID?

To find it, do the following:

  1. Sign in to your Google Analytics account.
  2. Click Administrator.
  3. At the top of the Resource column, select the required resource.
  4. In the Resource column, click Data Streams.
  5. Select the data stream for which you need an ID.
  6. The view ID "G-" is in the upper right corner.
Last updated on: 23/05/2024
icon