Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

User ID в Google Analytics


 Share

Recommended Posts

Всем привет. Пытаюсь разобраться без модулей и плагинов как можно передавать USER ID для Google Analytics. Сейчас вышел новый тег gtag.js, где изменилась конструкция отправки на 

 

gtag('config', 'UA-110925811-1', {
  'user_id': '{USER_ID}'
});

 

где необходимо в {USER_ID} прописать ID пользователя при авторизации или регистрации в личном кабинете. Кто-нибудь сталкивался с этой задачей? Пытался передать через $customer_id, но в отчете так и пишет $customer_id http://prntscr.com/hl9sve

 

Интересует решение именно без модулей Google Tag Manager

 

Спасибо

Edited by karnager
Link to comment
Share on other sites


Вы настраивали USER ID без чужих модулей и плагинов? Могли бы помочь?

 

Я вставляю в код Analytics код отсюда https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id?hl=ru

 

Вместо USER_ID вашу строчку, но в результате код вообще перестает работать. Что-то нужно еще на других страницах изменять? Регистрации, логина?

 

ga('create', 'UA-XXXX-Y', { 'userId': 'USER_ID' });

ga('send', 'pageview');

 

Я хочу отслеживать с помощью USER ID залогиненных пользователей на сайте с компьютера и мобильника и инициализировать их как одного юзера в отчете

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.