Where do I find my Google Analytics profile ID?
I want to use the Google Analytics sensor of PRTG. How do I determine my «Profile ID»?
Last change on May 3, 2012 3:15:45 PM by Daniel Zobel [Product Manager]
Accepted Answer
0
Determine your Google Analytics Profile ID
If you don’t know your profile ID, please open the Google Analytics website, login, and select the website you want to monitor with PRTG.
In your web browser’s URL field you will see content similar to this:
Please note the structure at the end of the URL:
/a[6 digits]w[8 digits]p[8 digits]
The 8 digits that follow the «p» are your profile ID. In the example above, this would be 12345678.
Note: To use the Google Analytics sensor, you have to enable Access for less secure apps in section Account permissions on https://www.google.com/settings/security
Otherwise, you might get the error message «The remote server returned an error. (403) Forbidden.»
See Also
- Where do I find available Google Analytics metrics?
- How can I integrate Google Analytics into PRTG?
Last change on Sep 26, 2014 11:11:07 AM by Gerald Schoch [Paessler Support]
0
PTF.GAMetrics
PTF.GAMetrics is a tool that can be used to determine your Google Analytics ID and build a list of metrics for your Google Analytics sensor.
Enter your Google Email and Password, press the «Get ID’s» button and all your Google Analytics ID’s, together with there, name will be listed.
In the «Metrics» section, you can simply select the metrics you want to use and paste the generated string into the sensors metrics section.

GAMetrics can be downloaded here.
0
Did the format of the profile id change?
Created on Dec 13, 2014 5:21:37 PM by fhoek (0)
Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.
Курс Google Analytics → Как настроить User ID в Google Analytics
Не секрет, что для посещения сайтов, люди уже давно не ограничиваются одним устройством. Часто человек может выбирать какой-то товар со смартфона по пути на работу, потом в офисе зайти на сайт со стационарного компьютера, чтобы продолжить выбор, а заказ совершить на следующий день с домашнего ноутбука.
Если мы попытаемся отследить подобную цепочку взаимодействий пользователя с нашим сайтом через Google Analytics, то у нас ничего не получится.
А все потому, что GA будет считать посещения с трех различных устройств, посещениями трех разных уникальных пользователей (Что такое Client ID).
Для связывания всех устройств одного пользователя в Google Analytics существует функция User ID, которая позволяет объединить различные сеансы и действия во время этих сеансов с уникальным идентификатором.
На картинке ниже раскрыта вся суть работы User ID.

Надеюсь суть ясна, теперь подробнее о настройке.
Настройка User ID в аккаунте Google Analytics
Выполните следующие действия:
Шаг 1
На данном шаге вы активируете соответствующую функцию для аккаунта.
- Войдите в аккаунт Google Analytics.
- Нажмите «Администратор» и перейдите к ресурсу, в котором вы хотите включить User ID.
- В столбце РЕСУРС нажмите «Код отслеживания» > «User ID».
- Ознакомьтесь с условиями использования User ID.
- Под текстом «Я принимаю правила в отношении User-ID» установите переключатель в положение «ВКЛ».
- Нажмите «Далее».
Шаг 2
На данном шаге приведен пример кода для передачи значения User-ID в Google Analytics, подробнее о том, как это правильно сделать, я расскажу ниже.
- Включите объединение сеансов.
- Нажмите «Далее».
Шаг 3
На завершающем шаге вы создаете отдельное представление с User ID.
В этом представлении будут отображаться данные о сеансах, в которых был обнаружен идентификатор пользователя. Информацию об остальных сеансах смотрите в отдельном представлении без функции User ID.
- Нажмите кнопку «Создать».
- Укажите название представления.
- Укажите часовой пояс.
- Нажмите кнопку «Создать».
Настройка кода для передачи USER ID
Перед настройкой кода необходимо определиться с тем как отправлять User ID в Google Analytics и откуда его собственно брать.
Отправка с помощью кода отслеживания Google Analytics
ga('create', 'UA-XXXX-Y', < 'userId': 'User_ID' >); ga('send', 'pageview');
Важно! Значением User_ID должен быть уникальный идентификатор пользователя.
Пример реализации на PHP из хелпа Google:
Отправка с помощью Google Tag Manager
- Откройте GTM и перейдите к тегу Universal Analytics.
- Выберите «Дополнительные настройки» > «Поля, которые необходимо задать» и нажмите кнопку «+ Поле«.
- Введите следующие значения:

Переменная > может получать значения либо из файла cookie, либо из dataLayer (уровня данных). Мне лично нравится использовать для этого cookie и ниже я расскажу почему.
Откуда брать значения для User ID
Вот мы и подошли к самому интересному пункту, который другие авторы в своих статьях чаще всего опускают со словами:
Ну, это должны делать разработчики сайта…
Я не такой как остальные и все вам расскажу
Настраивать User ID будем на сайте под управлением 1С Битрикс. Информацию о User ID мы можем получить из переменной GetID() , которая доступна в объекте $USER , содержащем все данные о зарегистрированном пользователе.
Разместим следующий код в шапке основного шаблона вашего сайта:
IsAuthorized()) //Проверяем авторизован ли пользователь. setcookie('UserID', $USER->GetID(), time()+63113852,'/'); //Устанавливаем куку UserID содержащую ID пользователя в Битриксе, сроком на два года и для всех страниц сайта. ?>
Важно! Правила Google Analytics требуют прекратить отслеживание User ID после выхода пользователя с сайта. В этом случае вам нужно будет сбросить User ID.
В моем коде это правило не соблюдается, так что думайте сами рисковать или нет. Чтобы правило соблюдалось, нужно убрать проверку авторизации и тогда при выходе пользователя кука перезапишется на пустое значение.
Далее проверим через консоль, что кука передается:

После идем в Tag Manager и настраиваем переменную:

И обновляем настройки тега Universal Analytics. Передавать значение будем и в User ID и в пользовательский параметр (как создать пользовательский параметр), который в будущем можно будет использовать в отчетах:

Тестируем при помощи предварительного просмотра GTM правильность передачи пользовательского параметра:


Кросс-девайсные отчеты
После реализации всех настроек в Google Analytics станут доступны несколько отчетов.
Охват User ID
В любом стандартном представлении, в группе отчетов «Аудитория» > «Поведение» станет доступен отчет по доле пользователей, которым был присвоен User ID. В данном отчете мы можем сравнить сегменты авторизованных и не авторизованных пользователей, посмотреть транзакции, источники, проанализировать доходность этих сегментов.

Пересечение устройств
Данный отчет позволяет узнать, сколько различных типов устройств применяют пользователи при взаимодействии с вашим сайтом и в каком соотношении.
Также при помощи этого отчета можно объединить пользователей по типам используемых устройств и сравнить показатели эффективности для каждого типа. Например, может оказаться, что мобильные пользователи приносят меньший доход, чем пользователи заходившие с нескольких устройств.

Пути устройств
В данном отчете мы можем увидеть цепочки переходов, которые используют пользователи сайта. Также как и в предыдущем отчете, можно посмотреть транзакции и доходность по каждой из цепочек.
Эти данные пригодятся для оптимизации стратегии таргетинга рекламных объявлений на пользователей устройств соответствующего типа.

Устройство, на котором произошла конверсия
С помощью этого отчета вы можете узнать, сколько привлеченных вами пользователей с помощью конкретного типа устройства совершили конверсию на устройстве того же или другого типа.

Идентификация конкретного пользователя
И напоследок самое важное! То, что приближает нас к сквозной аналитике, а именно идентификация конкретного пользователя.
Напоминаю, что в Google Analytics запрещено загружать персональную информацию (подробнее от ограничениях GA). Однако, никто не запрещает загружать ID клиента из вашей CRM-системы или админки сайта (в моем кейсе это ID пользователя 1С Битрикс).
Соответственно, имея идентификатор пользователя из CRM в Google Analytics, мы можем с точностью сказать что:
Роман Романчук заходил на сайт такого-то числа, из такого-то источника и купил такие-то товары.
На этом все, пользуйтесь.
Что такое user id в google analytics
My Step-By-Step Blueprint For Learning and Mastering Google Analytics 4 (GA4)
Get the FREE e-book on Google Analytics 4 – GA4 (142 Pages)
Download the FREE ebook
Last Updated: October 15, 2023
What is Google Analytics User ID?
Google Analytics User ID is a unique set of alphanumeric characters (like GdffTeeD453589) assigned to a user so that he/she can be identified across devices/ browsers and over the course of multiple sessions.
What is the advantage of using User ID in Google Analytics?
The usage of the user ID feature makes cross-device measurement possible in Google Analytics for the logged in users.
Which in turn helps to fix cross-device attribution issues.
This is the biggest benefit of using user IDs.
Without user ID implementation, a unique user can be counted multiple times by Google Analytics.
Especially if the user is logging into your website from different devices or browsers each time.
Let us suppose a user logs in to your website via a smartphone.
Later he makes a purchase via his laptop.
Now without the user ID implementation, the number of unique users could be counted and reported as two in GA.
One user visited your website via a smartphone but did not make a purchase.
The second user visited your website via a laptop and then made a purchase.
However, after the user ID implementation, the number of unique users would be counted as one in GA.
This is because the same logged-in user can then be uniquely identified across devices.
User ID is also a great feature to segment and analyze logged-in users.
These users generally engage with your website in a very different way from those who are not logged in.
So through the user ID feature, you can get a holistic view of the purchase journey of logged-in users.
This is something which is not possible otherwise.

My Step-By-Step Blueprint For Learning and Mastering Google Analytics 4 (GA4)
Get the FREE e-book on Google Analytics 4 – GA4 (142 Pages)
Download the FREE ebook
Overview of setting up User ID in GA4 (Google Analytics 4)
#1 Ask your developer to fire the ‘login’ event and push the Login ID as the user ID to the data layer (hard coded on your website) once a user successfully logs in. The screenshot below is an example of the data layer which your developer can use.
#2 Ensure the developer correctly pushes the User ID into the dataLayer upon successful login via GTM preview and debug mode.
#3 Navigate to your GTM container and create a new data layer variable which fetches the user ID from the data layer hardcoded on your website.
#4 Add the ‘user_id’ configuration parameter to your Google Tag and all GA4 event tags. Use the data layer variable you created in the previous step as the value of the ‘user_id’ configuration parameter.
#5 Refresh the GTM preview mode, navigate to Google Tag (under the ‘Tags fired’ section) and then check for the ‘user_id’ parameter with a certain value.
#6 Navigate to the GA4 debugView report and check one or more GA4 event tags to confirm they also send the ‘user_id’ parameter.
#7 If everything works correctly, publish the changes in your container.
#8 After 24 to 48 hours have elapsed, navigate to the ‘user explorer’ report, where you can see the user id data.
Here is how you can filter out User ID data in GA4.
GA4 uses a dimension called ‘Effective User ID’.

This dimension reports on the User ID if one is available. Otherwise, it reports on the Device ID.
The Device ID is either the app instance ID for a mobile app or the client ID for a website.
So, when you look at the values of this dimension, you can see both the user IDs and device IDs.
GA4 does not allow you to use the ‘Effective User ID’ dimension in the dimension filter.
So you will have to use another dimension called ‘Signed in with user ID‘ while creating the reporting filter in the ‘user explorer’ report.
This dimension returns ‘yes’ if a user signed in with a user ID.
Use this dimension to filter out all the data related to user IDs.
What you can use as a User ID?
Google Analytics cannot generate unique IDs for you that can be used as User IDs. You also can not use Client IDs as User IDs.
It doesn’t work that way.
In order to implement the User ID feature, you need to generate your own unique IDs and assign IDs to new and returning users through your user authentication system.
This user authentication system is usually your website login, the system through which users can log in and log out.
The unique ID that you use to identify a logged-in user (also known as login ID) on your website can be sent as a User ID to your GA account.
However, the login ID should not contain personally identifiable information (PII) like name, email address, etc.
If your login ID contains PII then you may need to either remove that information from the Login IDs or completely rewrite the Login IDs before you send the Login IDs as User IDs to GA.
This is because the User ID usage policy requires that the User ID should not be a PII of a user.
If you do not follow this usage policy, then Google may terminate your GA account.
In order to implement User ID, you would need to write code that can pull login IDs or other unique IDs from your authentication system and then place them in your Google Analytics tracking code.
That way the User IDs can be sent to the GA server along with the hit data.
Consequently, any website which assigns login IDs to its users is a good candidate for implementing the User ID feature.

My Step-By-Step Blueprint For Learning Google Analytics 4 BigQuery
Get the only ebook on GA4 BigQuery ever published (83 Pages)
Download the FREE ebook
Implementing User ID without a login
You can implement User ID features in many ways other than through a login system
For example, Walt Disney World tracks offline customers through a special wrist band known as the ‘magic band’.
This colourful, harmless, innocent-looking band, which is used to enter the parks, check in to Disney hotels, buy food and merchandise is actually a sort of tracking device through which the company collects the browsing and buying behaviour of their offline customers.
Then through measurement protocol and User ID feature, this offline customer data is connected with the online data to get a holistic view of the customers’ journey.
Similarly, if someone uses some type of loyalty card for making a purchase in a supermarket, then that loyalty card can be scanned to assign a unique ID to the user which can later be sent to GA via measurement protocol and User ID.
Other users’ authentication systems widely used are:
- Biometric identification (like retinal scan, fingerprint scan, iris recognition, voice recognition, signatures, etc)
- Punching cards to record attendance (like attendance of employees)
- Wrist bands (like the one used by Disney)
- Retail loyalty cards (used by many supermarket chains)
- Online and offline Coupons
User IDs can be set for all of these authentication systems as well with the help of measurement protocol, but the implementation is not going to be easy.
Once the User ID feature is implemented, GA combines and reports all the hits with the same User ID, regardless of which device the hits come from. This makes cross-device measurement possible in GA.
You can send User ID to Google Analytics by creating a new custom dimension (with user scope):
ga(‘set’, ‘dimension1’,userId);
Note: You can implement the User ID feature for both websites and mobile applications.
Difference between Google Analytics User ID and Client ID
Through User ID, you can create and assign your own unique IDs to track unique users instead of using the Client IDs (generated by the Google Analytics tracking coding).
A Client ID represents a unique device/browser. Whereas a User ID represents a unique user that may interact with your website using multiple devices/browsers.
It is important that you understand the difference between Client ID and User ID and do not get confused. They are not the same thing.
To learn more about the difference between Client ID and User ID, read this article: Understanding the difference between Client ID and User ID
Benefits of using Google Analytics User ID
#1 The usage of the User ID feature makes cross-device measurement possible in GA. This is the biggest benefit of using the User ID.
#2 Through the User ID feature, GA can more accurately identify the number of unique users and their engagement activities (click on links, page navigation, screen navigation, etc) across multiple devices and/or sessions. Unlike Client ID, the User ID can exist on multiple devices.
If a user is accessing your website from different devices/browsers then without User ID implementation, a unique user can be counted multiple times by GA.
If a user logs in to your website via smartphone and then later made a purchase via a company laptop, then in GA without User ID implementation, the number of unique users could be counted as two. But after User ID implementation, the number of unique users would be counted as one.
#3 You can attribute user engagement spread across multiple devices and sessions to a single user in your GA reports. Thus, User ID helps in fixing attribution modelling issues.
#4 Through the User ID feature, you can get a holistic view of the users’ purchase journey.
#5 User ID is a great feature to segment and analyze the logged in users, as these users generally engage with your website very differently than those who are not logged in. Logged in users behave differently than non-logged in users and you should create separate marketing campaigns to retarget them, to cross-sell or upsell them.
#6 When you set up a User ID, you also get access to a special User ID view and cross-device reports in your Google Analytics account. User ID view is the Google Analytics view that displays only the sessions which contain User ID (the user is logged in) and their activity. This allows you to get a better understanding of user behaviour on the website and the activities they carry out.

My Step-By-Step Blueprint For Querying GA4 data in BigQuery without understanding a single line of SQL.
Query GA4 BigQuery Data via ChatGPT (73 Pages)
Download the FREE ebook
User ID hits and sessions
In order to understand how User ID works, you need to get familiar with the User ID related terminologies that are frequently used:
1. User ID hits – these are those GA hits (pageviews, screenviews, events, transactions, etc) for which a User ID has been set.
2. Non-User ID hits – these are those GA hits for which a User ID has not been set.
Note(1): User ID hits are processed separately from non-User ID hits.
Note(2): If you are not using the User ID feature then the non-User ID hits are simply known as hits.
3. User ID session – It is the Google Analytics session in which a User ID is assigned to a user. User ID session is a collection of User ID hits but may also include non-User ID hits provided the session unification setting (more about it later) has been turned ON.
4. Non-user ID session – it is a collection of non-user ID hits. If you are not using the user ID feature then the non-user ID sessions are simply known as GA sessions.
Note: A standard session (non-user ID session) turns into a user ID session the moment a user ID is assigned to a user. This can happen when a user login in the middle of a standard GA session.
User ID Property
User ID property is that Google Analytics property in which user ID setting has been turned on:

User ID View
User ID view is the GA view which collects only the data related to user ID sessions:

You know you are looking at the User id view when you see the setting ‘User ID Reports‘ enabled under ‘View Settings’.
You should consider adding the words ‘User ID’ somewhere in your view name for easy reference.
In the case of User ID views, GA calculates unique users by counting the number of unique User IDs assigned to the website visitors instead of counting the number of unique Client IDs assigned to the website visitors.
![]()
My Step-By-Step Blueprint For Setting up Server Side Tracking via Google Tag Manager.
Server Side Tracking Via Google Tag Manager (83 Pages)
Download the FREE ebook
Non-User ID View
Non-User ID view is the GA view that collects data related to standard GA sessions.
It does not recognise User ID hits. In the case of non-User ID views (regular views), GA calculates unique users by counting the number of unique Client IDs assigned to the website visitors.
You know you are looking at the non-User ID view when you see the setting ‘User ID Reports‘ disabled under ‘View Settings’:

If you are not using the User ID feature then the non-User ID views are simply known as views.
The number of unique users reported by non-User ID views is usually more than the number of unique users reported by User ID views. This is because User ID views only report on the users which triggered the User ID sessions.
Revenue in a User ID view is based on users and not sessions.
When does a regular GA session turn into a User ID Session?
If you are using login IDs as User IDs then as soon as a user logs in, a unique ID (login ID) is assigned to the user which is then sent as a User ID to GA. So once the user login, a regular GA session turns into a User ID session and the User ID is set for all subsequent hits.
By default, In Google Analytics, collected hits can be associated with a User ID only in a User ID session and that too before and during the user’s login but not after the user has logout.
So, if the user doesn’t log in then the User ID is not assigned to him and no hits are associated with the User ID. Similarly, when the user logs out, the User ID is no longer assigned to him and the new collected hits are not associated with the User ID.
Limitations of User ID
Through the User ID feature, you can not track users and their activity from the very first time they visited your website and before they decided to sign up and log in. Thus, the User ID feature works well only for logged in users.
Now not all the users who visit your website login. So you may not be able to track a large portion of the users’ conversion journey. In order to overcome this limitation, you can keep your users logged in unless they explicitly logged out.
For example, Facebook keeps its users logged in all the time unless they explicitly logged out. In this way, Facebook is able to collect most of the cross-device behaviour data about its users.
Here are a few more User ID limitations:
- Assigning User ID: Google Analytics on its own cannot generate or assign a User ID. This is generally done by the authentication system you use, Once the user signs up, or logs in, to your website, the User ID is passed to Google Analytics.
- Product integration: You can connect Google Ads or Search Ads 360 with the User ID view, but you cannot integrate (connect) User ID view with Display & Video 360, Campaign Manager 360 and Google Ad Manager.
- Feature limitations: A few Google Analytics features are not available in the User ID view:
- Real-time reporting: Google Analytics does not show real-time data for User ID view. Data in the User ID view comes from the identified sessions. To protect individual user data (PII regulations) real-time view is not supported in User ID views.
- Demographics and interest reports: The PII regulations also apply to demographics and interest reports which combine gender, age, and interest details of the users. Hence you won’t see any demographics and interest reports in the User ID view.

My Step-By-Step Blueprint For Becoming GDPR compliant with Google Analytics 4 (GA4).
GA4 GDPR Compliance Checklist (97 Pages)
Download the FREE ebook
Overcoming the limitations of User ID through session stitching
You can associate Client IDs with User IDs to track users’ activities before they decided to sign-up and login through a method known as Session unification (or session stitching).
Thus, to an extent, you can overcome the limitations of the User ID.
If a person visits your website without logging in, then a unique Client ID is assigned to him. Now if the same person later logged in, then a unique User ID is assigned to him.
By associating the Client ID with the User ID, you can determine what the logged-in person did on your website before he signed up and/or logged in. In this way, you can get a better picture of the user’s purchase journey.
‘Session Unification’ won’t solve all your attribution issues.
Associating Client ID with User ID works well only when a person is visiting and logging in to your website via the same device and browser and he is the only person using that device and browser.
If multiple users are using the same device and browser (quite common in the case of cyber cafes or office computers) then there is no guarantee that the person who browsed your website without logging in, is the same person who later visited your website after login.
Similarly, a person can visit your website via multiple devices and browsers before logging in. In that case, he would be assigned multiple Client IDs but only one User ID. Session unification associates only one Client ID with the User ID.
How to turn off session unification
Session unification is a User ID setting that can be turned ON and OFF.
Session unification is turned ON by default and it should be kept turned on unless your company’s privacy policy issue prohibits you from collecting such data.
Since the session unification setting is turned ON by default, all of the hits collected before the login and during the login, in a User ID session are automatically associated with the User ID.
If the session unification setting is turned off then only the hits collected during the login, in a User ID session can be associated with User ID. The hits collected before the login in the User ID session cannot be associated with the User ID then.
To turn off the session unification follow the steps below:
Step-1: Navigate to the ‘Admin’ section of your User ID view .
Step-2: Click on the ‘User ID’ link under the ‘Tracking Info’ drop-down menu:

Step-3: Click on the ‘Edit’ link next to the step: ‘Set up the User ID’:

Step-4: Scroll down a bit and then set the ‘Session Unification’ toggle switch to OFF:

Note(1): Turning OFF the session unification setting is not recommended.
Note(2): Session unification is only available for User ID enabled properties.

Get this 70 page detailed checklist containing screenshots, step-by-step instructions and links to articles
Do you want to set up Google Analytics 4 (GA4) fast and correctly?
Yes I want the ebook
How session unification works
Let’s take an example of how session unification works. The below image explains how session unification works when it is turned off.

Session 1: A user lands on your website and generates hits (events or pageviews). But the user is not signed in and hence no data will be assigned to any User ID
Session 2: A user lands on your website and generates hits (events or pageviews) and after this, the user signs in (specific User id is assigned) and generate more hits. In this complete session Hit 1 and Hit 2 will not be assigned with User ID if the session unification is turned “Off”. While Hit 3, Hit 4 and Hit 5 will be assigned to a User ID.
Session 3: In this session, the user is signed in for the complete session and hence all hits (events and page views) will be assigned to the User ID.
Session 4: In Session 4, the user is signed in when the session started, then he generates Hit 1 and Hit 2 and after that, he signs out. The user continues browsing and generates Hit 3, Hit 4, and Hit 5. In this session only Hit 1 and Hit 2 will be associated with the User ID (Since the user was signed in) but Hit 3, Hit 4, and Hit 5 will not be associated with User ID even they are recorded in the same session.
Session 5: In the complete session, the user is not signed in and hence all hits in this session will not be assigned with a User ID
Session 6: In this session, the user is signed in for the complete session and hence all hits (events and page views) will be assigned to the User ID.
Now let’s take another example of how session unification works when it is turned ON:

Session 1: A user lands on your website and generates hits (events or pageviews). But the user is not signed in and hence no data will be assigned to any User ID
Session 2: A user lands on your website and generates hits (events or pageviews) and after this, the user signs in (a specific User id is assigned) and generate more hits. In this complete session, all Hits will be assigned with User ID if the session unification is turned “On”.
Session 3: In this session, the user is signed in for the complete session and hence all hits (events and page views) will be assigned to the User ID.
Session 4: In session 4, the user is signed in when the session started, then the user generates Hit 1 and Hit 2 and after that, he signs out. The user continues browsing and generates Hit 3, Hit 4, and Hit 5. In this session only Hit 1 and Hit 2 will be associated with the User ID (Since the user was signed in) but Hit 3, Hit 4, and Hit 5 will not be associated with a User ID, even though they are recorded in the same session.
Session 5: In the complete session, the user is not signed in and hence all hits in this session will not be assigned with a User ID
Session 6: In this session, the user is signed in for the complete session and hence all hits (events and page views) will be assigned to the User ID.

My Step By Step Guide for fixing Google Analytics 4 Tracking Issues
Get the ebook on Google Analytics Troubleshooting Guide (39 Pages)
Download the FREE ebook
Setting up the User ID
The user ID feature is available only in universal analytics and is set at the property level. The implementation of User ID depends upon your environment/platform.
Setting up the User ID includes:
- Creating a new User ID view
- Generating unique IDs and then assigning them to website users.
- Sending IDs and all related engagement data to GA
How to create a new User ID view in Google Analytics
Follow the steps below to create a new User ID view in Google Analytics:
Step-1: Navigate to the Admin section of your GA Property and then click on the ‘User ID’ link under the ‘tracking info’ drop-down menu:

Step-2: Read and agree to the User ID policy by toggling the blue switch to ‘ON’ and then click on the ‘Next Step’ button.

Step-3: Keep the ‘Session Unification’ setting intact (i.e. switched ON) and click on the ‘Next Step’ button:

Step-4: Click on the ‘Create’ button to create a new User ID view:

Note: The User ID data will appear only in the User ID view.
Step-5: Select your app (website or mobile app) for the User ID view:

Step-6: Name your new reporting view and select your ‘reporting time zone’:

Tip: Include the word ‘User ID’ somewhere in the reporting view name. This way, you can easily differentiate this view from regular views.
Step-7: Toggle ‘On’ the ‘Show User ID Reports’ button and then click on the ‘Create View’ button.

The process of creating the new User ID view is now complete.

Get this 70 page detailed checklist containing screenshots, step-by-step instructions and links to articles
Do you want to set up Google Analytics 4 (GA4) fast and correctly?
Yes I want the ebook
Important points about the User ID view
#1 Make sure that, whenever you create a new User ID view, you include the words ‘User ID’ somewhere in your view name. This way, you can easily identify this reporting view later.
#2 You can create multiple User ID views on a User ID enabled property. The process is similar to creating multiple non-User ID views. Just turn the ‘User ID view’ toggle to ‘ON’.
#3 A User ID view collects and reports on only User ID sessions related data. So in order to get a complete picture of customer journeys, you need to use this view along with the non-User ID views.
#4 You will see data in your User ID view reports only after you have successfully implemented the User ID feature. Otherwise, your User ID view reports will remain empty. You won’t see any data in them, not even in the real-time reports.
#5 Cross-device reports are available in the User ID views.
#6 Any existing non-User ID view cannot be converted to a User ID view and vice versa. Therefore to collect User ID data, you have to create a new User ID view.
#7 User ID view collects data only after the User ID feature has been implemented. It can’t collect data retroactively.
#8 Once you have enabled the User ID feature for a view, you cannot disable it.

My Step By Step Guide for preparing for the GAIQ exam with real questions and correct answers
Get the ebook on GAIQ Exam Preparation (62 Pages) – 150+ real GAIQ questions with correct answers
Download the FREE ebook
How to generate, assign (to website users) and send User IDs to Google Analytics using Google Analytics tracking code (analytics.js)
Add the following line of code to your Google Analytics tracking code, on each web page of your website before any hit data is sent:
So your Google Analytics tracking code may look something like the one below:
ga(‘create’, ‘UA-1234567-34’, ‘auto’);
Note: Do not copy-paste this code on your website. It won’t work. You would need to first modify this tracking code.
USER_ID>> is a server variable (of type string) that pulls the unique ID generated by your authentication system.
You or your developer needs to write a code through which login IDs can be pulled from your authentication system and sent as User IDs to GA.
Your final Google Analytics tracking code after User ID implementation is also going to include some server-side script.
For example, if you use PHP as the backend script then your final Google Analytics tracking code may look like the one below:

Ask your developer to write a code through which login IDs can be pulled from your authentication system and sent as User IDs to Google Analytics.
There are two points, you need to keep in mind before setting up the User ID:
#1 The User ID must be set after the tracking object has been created
#2 The User ID must be set before you send any hit data to Google Analytics
1. The User ID must be set after the tracking object has been created
The User ID must be set after the tracking object has been created. otherwise, the User ID will not be associated with your web property and won’t work.
The following User ID set up will not work:
ga(‘set’, ‘userId’, >); // User ID is set before the tracking object
ga(‘create’, ‘UA-1234567-34’, ‘auto’); // create a tracking object
The correct User ID set up would be:
ga(‘create’, ‘UA-1234567-34’, ‘auto’); // create a tracking object
ga(‘set’, ‘userId’, >); // User ID is set after the tracking object
Note: The User ID must be set on all the pages of your website otherwise you may not get accurate user data.
2. The User ID must be set before you send any hit data to Google Analytics
The User ID must be set before you send any hit data to GA. In this way, the User ID is set for all subsequent hits that occur on a page.
So following User ID set up is not recommended:
ga(‘create’, ‘UA-123456-34’, ‘auto’);
ga(‘set’, ‘userId’, >); // here User ID is set after the pageview hit
The correct set up would look like the one below:
ga(‘create’, ‘UA-1234567-34’, ‘auto’);
ga(‘set’, ‘userId’, >); // here User ID is set before the pageview hit
Similarly, the following User ID set up is not recommended:
ga(‘create’, ‘UA-1234567-34’, ‘auto’);
setTimeout(“ga(‘send’,’event’,’Profitable Engagement’,’time on page more than 3 minutes’)”,180000);
ga(‘set’, ‘userId’, >); // here User ID is set after the event hit

My Step-By-Step Blueprint For Setting up Phone Call Tracking in GA4 (Google Analytics 4)
Google Analytics Phone Call Tracking Setup (83 Pages)
Download the FREE ebook
How to send User IDs to Google Analytics using Global Site Tag (gtag.js)
To set User ID using Global Site Tag (gtag.js), you can use below command with the tracking code.
gtag(‘config’, ‘UA-XXXX-YY’,
‘user_id’: ‘USER_ID’
Your final code may look like below
gtag(‘js’, new Date());
‘user_id’: ‘USER_ID’
User ID coverage report
Through the User ID coverage report, you can determine the percentage of sessions that include activity from logged in users (provided your authentication system is login). Strangely you can’t access the User ID Coverage report through the User ID view.
This report is available in any non-User ID view which belongs to a GA property for which the User ID is enabled. You can find this report under Audience > Behavior > User ID Coverage:

This report shows the User ID status, which can be:
- Unassigned – the number/percentage of sessions in which users weren’t assigned a User ID.
- Assigned – the number/percentage of sessions in which users were assigned User ID.

Note: Use the User ID Coverage report in conjunction with User ID view reports.

Get this 70 page detailed checklist containing screenshots, step-by-step instructions and links to articles
Do you want to set up Google Analytics 4 (GA4) fast and correctly?
Yes I want the ebook
Cross-device reports in Google Analytics
Once you have set up User ID in your Google Analytics property, you can then access and use the cross-device reports via the User ID view.

Through cross-device reports, you can get a better understanding of how users engage and convert on your website across different devices and over the course of multiple sessions. The sample report looks like below:

You also get the total number of users using multiple devices:

Related Articles
- Google Signals in Analytics – Tracking users across devices without login
- Cross Device Reports in Google Analytics (without user login)
Frequently Asked Questions About User ID in Google Analytics
What is User ID in Google Analytics?
User ID is a unique set of alphanumeric characters (like 987eeetgd) assigned to a user so that he can be identified across devices/ browsers and over the course of multiple sessions.
How do I find my Google Analytics User ID?
You can find your Google Analytics User IDs by navigating to the User Explorer report under the ‘Audience’ menu in your User ID view.
How do I enable Google Analytics User ID?
To enable the Google Analytics User ID, follow the steps below:
#1 Navigate to the Admin section of your GA Property and then click on the ‘User ID’ link under the ‘Tracking info’ drop-down menu.
#2 Read and agree to the User ID policy by toggling the blue switch to ‘ON’ and then click on the ‘Next Step’ button.
#3 Read and agree to the User ID policy by toggling the blue switch to ‘ON’ and then click on the ‘Next Step’ button.
#4 Click on the ‘Create’ button to create a new User ID view.
#5 Select your app (Website or Mobile App) for the User ID view.
#6 Name your new reporting view and select your ‘reporting time zone’.
#7 Click on the ‘Create View’ button.What is the difference between User ID and Client ID?
A Client ID represents a unique device/browser. Whereas a user ID represents a unique user that may interact with your website using multiple devices/browsers.
Is User ID the same as email address?
No. User ID is usually the login ID. However, the login ID should not contain personally identifiable information (PII) like name, email address, etc as it is against Google Analytics Terms of Service.
My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.Attribution Modelling in Google Analytics and Beyond SECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.About the Author
Himanshu Sharma

- Founder, OptimizeSmart.com
- Over 15 years of experience in digital analytics and marketing
- Author of four best-selling books on digital analytics and conversion optimization
- Nominated for Digital Analytics Association Awards for Excellence
- Runs one of the most popular blogs in the world on digital analytics
- Consultant to countless small and big businesses over the decade
Client ID и User ID — первые шаги на пути к пониманию пользователя
Что такое Client и User ID, зачем эти параметры нужны в системах аналитики и как они работают в Метрике и Analytics, рассказывает маркетолог OWOX Марго Бергер.

Ещё больше полезных статей и смешных мемов в нашем Telegram-канале
Этот материал был написан в 2019 году. Мы обновили его в декабре 2021 года. Прияного чтения!
Уникальные пользователи, новые и вернувшиеся, каналы трафика и показатели конверсии — любой вопрос к системе аналитики начинается с малого — с идентификации пользователя. Для этого используются Client и User ID.
Что такое Client ID
Client ID — это анонимный идентификатор браузера . Система аналитики формирует его, чтобы опознавать уникальных пользователей и связывать действия каждого из них друг с другом.
Другими словами, когда система аналитики — Google Analytics или Яндекс.Метрика — формирует отчет по уникальным посетителям сайта, то имеет в виду именно количество уникальных браузеров, которым присвоен Client ID. Если один человек зашел на сайт с двух разных устройств или браузеров — в отчете будет отражено два уникальных посетителя. Если четыре человека зашли на сайт с одного браузера в течение короткого времени — для системы аналитики это будет один посетитель с четырьмя сессиями.
Да, система не идеальна, но это лишь первый шаг на пути идентификации пользователя. Client ID дает возможность различать и узнавать уникальных посетителей, собирать их действия на сайте в сессию и связывать между собой данные о сессиях, произошедших в разное время.
Client ID представляет собой набор цифр, записанных в файл cookie.
В Google Analytics он выглядит так: _ga=GA1.1.1135380329.1543226534
- _ga — название cookie;
- GA1 — универсальная часть для всех cookies подобного формата;
- цифра 1 указывает на уровень домена, в данном случае это домен верхнего уровня;
- первый блок из десяти цифр — число, сгенерированное случайным образом;
- последняя часть — время создания cookie в формате UNIX.
А так в Яндекс.Метрике: _ym_uid=1543226534123620835
- _ym_uid — название cookie;
- первые десять цифр — время создания cookie в формате UNIX;
- вторые десять цифр — число, сгенерированное случайным образом.
Можно заметить, что хоть формат записей и отличается, часть Client ID в обеих системах аналитики совпадает — 154322653 . Верно, ведь обе cookie были взяты с одной страницы, на которой установлено два кода отслеживания. А значит, время создания Client ID в обеих системах одинаково. Хотя и не исключены ситуации, когда скрипты сработали с разницей в секунды — в таком случае последняя цифра будет отличаться.
Сколько хранится такой cookie-файл? Вопрос с подвохом. Еще недавно ответить на него было просто — он хранился два года с момента последнего визита или период, установленный в настройках браузера. Сейчас же браузеры начали существенно ограничивать срок жизни cookie-файлов. Например, в новом Safari они хранятся только две недели, независимо от настроек сайта. Это означает, что если посетитель зашел на сайт с разницей в 16 дней, то для системы аналитики это уже два разных пользователя, так как при втором посещении предыдущего cookie уже нет и браузер записал новый файл.
Где искать Client ID в отчетах аналитики
В Google Analytics в отчете «Аудитория» — «Статистика по пользователям» можно увидеть идентификаторы посетителей сайта, а также количество сессий, показатель отказов, транзакции, доход и коэффициент конверсии по каждому пользователю.
Чтобы увидеть более детальную информацию о посетителе и о каждом его действии, нужно кликнуть по определенному Client ID.
По умолчанию Client ID доступен только в этом отчете Google Analytics. В него можно добавлять сегменты, но он не сможет сгруппировать Client ID с другими параметрами, например источниками и каналами трафика, устройствами, URL перехода и т. д. Чтобы получить доступ к идентификатору в других отчетах Google Analytics, нужно дополнительно передавать Client ID в качестве пользовательского параметра, например, через функцию customTask. Подробную инструкцию к тому, как это сделать, можно прочитать в блоге OWOX.
В Яндекс.Метрике не нужно специально настраивать передачу Client ID, достаточно в отчете нажать кнопку «Группировки» и выбрать «Аудитория > Client ID» и увидеть отчет по конкретным пользователям.

Также можно использовать Client ID как условие сегментации.
Что такое User ID
Если Client ID — это уникальный анонимный идентификатор браузера, то User ID — это уникальный идентификатор пользователя в вашей внутренней системе, который пользователь получил при регистрации.
С его помощью можно связать действия одного пользователя с нескольких устройств, объединить данные из CRM и собрать полную информацию — имя, телефон, email, номер карты лояльности. Так перед маркетологом появляется полная картина взаимодействий с пользователем: какие страницы он посетил; откуда перешел; какие письма ему были отправлены; что и как часто он покупает. В том числе это дает возможность учитывать и офлайн-конверсии.
У User ID нет единого стандартного вида — его нужно присваивать самостоятельно на стороне сайта, и затем передавать в системы аналитики.
Настройка User ID в Google Analytics
Чтобы начать использовать User ID, нужно активировать эту функцию для аккаунта:
- Во вкладке «Администратор» выбрать нужный Ресурс.
- В Ресурсе выбрать «Отслеживание» — «User ID» — «Включить».
Нужно доработать код отслеживания Google Analytics или настройки тега Google Analytics с помощью Google Tag Manager, передавая в него UserID, который выдает бекенд сайта. Подробнее о том, как это сделать — читайте в справке Google. И наконец, нужно создать отдельное представление с User ID.
В результате появится несколько новых отчетов. Например, в разделе «Аудитория» — «Разные устройства» — «Пересечение устройств», «Пути устройств», «Устройство — источник трафика».

Все ли так хорошо, как кажется? Нет. Дело в том, что в представлении, где включен User ID, будут показаны только пользователи с User ID. То есть, если пользователь не идентифицирован, и у него есть только Client ID, он не попадет в эти отчеты. Создать же представление, где были бы и пользователи, и браузеры невозможно. В итоге получается, что в представлении с Client ID данные не совсем точные (нельзя быть уверенным, что браузер = конкретный пользователь; куки могли устареть и часть данных уже утеряна), а в представлении с User ID есть далеко не все пользователи.
Понимая эти особенности, каждый маркетолог сам решает для себя, как ему использовать данные обоих представлений. Лучшим решением здесь могло бы быть — собирать сырые данные и самостоятельно объединять действия пользователей.
Настройка User ID в Яндекс.Метрике
Передавать идентификатор посетителя в Яндекс.Метрику можно во время посещения сайта и с помощью загрузки файла .csv. В первом случае используется JavaScript API, подробнее о настройке можно прочитать в справке Яндекс.Метрики.
Чтобы передать идентификатор, загрузив CSV-файл, достаточно перейти в раздел «Настройка» — «Загрузка данных» — «Загрузка параметров посетителей» — в типе файла выбрать «User ID» — «Загрузить данные».

Полученные данные можно использовать, чтобы формировать сегменты для подбора аудиторий в Яндекс.Директе и в Яндекс.Аудиториях. А для анализа полученной информации можно обратиться к отчету «Параметры посетителей».
Итого
Client ID автоматически присваивается системой аналитики и идентифицирует браузер, а не человека. User ID присваивается на стороне сайта или CRM. Это тот параметр пользователя, по которому можно объединить всю доступную о нем информацию: поведение на сайте, имя, телефон, email, номер карты лояльности — и связать все его действия в разных браузерах и на разных устройствах. По сути, User ID — это то, с чего начинается настоящая аналитика.
Следующий шаг — реализация кроссдевайсного отслеживания, которое обеспечит бесшовную коммуникацию с пользователем. Ведь сегодня все мы ожидаем, что, положив товар в корзину с телефона, сможем продолжить оформление заказа с компьютера. Пустая же корзина разочарует любого. Говоря об отчетах, стоит помнить, что за цифрами скрыты живые люди и задача маркетолога — проанализировать и понять их поведение, чтобы направить его в нужное бизнесу русло. Только тогда отчеты будут иметь ценность.