See User_id with django analytics and google analytics

I use Google Analytics to track and profile my website traffic. In the "User Explorer" section in GA, I see the internal identifier, not my site user_id.

How to add your own user_idin Google Analytics?

I also use django-analytical.

What should I do to solve this problem?

+4
source share
1 answer

Take a look at this one . What you have to do is send user_idto the following script:

ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in user_id.

So, let's say in your index template:

<script>
    /*Google Analytics Script*/
    ga('set', 'userId', {% user_id %});
</script>
+1
source

Source: https://habr.com/ru/post/1649930/


All Articles