简体   繁体   English

如何在Google Analytics(分析)报告中显示用户数据和用户ID

[英]how do i display user-data and user-id in google analytics report

I have turned on the userid policy in google analytics It provides me the 我已在Google Analytics(分析)中启用了userid策略,它为我提供了

 ga('set', 'userId', {{USER_ID}}); // Set the user ID using signed-in user_id. and i am using the codeigniter to get the userid from session

    <script>      
    ga('create', 'UA-98432350-1', 'auto');
    <?php

    if (isset($user_id)) {
      $gacode = "ga('create', 'UA-98432350-1', 'auto', {'userId': '%s'});";
     echo sprintf($gacode, $user_id);
     }     
    ?>

    ga('set', 'dimension1', 'its the dimension value');
    ga('send', 'pageview');

    </script>

this is the code i have used 这是我使用的代码

after applying this code user-explorer in Audience Tab is still showing the ClientId it is not showing userId. 在“受众群体”标签中应用此代码后,用户浏览器仍显示ClientId,但未显示userId。

I also want to get the user custom data in reports like its name, email etc. for that I have created custom dimension and right now sending hard coded value however it is not showing anywhere? 我还想在报告中获取用户自定义数据,例如其名称,电子邮件等,因为它们已经创建了自定义维度,现在正在发送硬编码值,但是它没有显示在任何地方?

在此处输入图片说明

You have to set up the UserID function in your Google Analytics Backend before you can use it: 您必须先在Google Analytics(分析)后端中设置UserID函数,然后才能使用它:

  1. Log in to your GA Account and go to "Admin" 登录到您的Google Analytics(分析)帐户,然后转到“管理员”
  2. Select the Property and click on "Tracking Info" -> here is the User-ID functionalty 选择属性,然后单击“跟踪信息”->这是用户ID功能
  3. Activate the User-ID 激活用户ID

It seems, that you have the same problem with you custom dimensions. 自定义尺寸似乎也存在相同的问题。 If you send custom dimensions (or custom metrics) to GA you first have to set up the dmension (or metric) in your GA Backend: 如果您将自定义维度(或自定义指标)发送到GA,则首先必须在GA后端中设置维度(或指标):

Admin -> Select Property -> Scroll down to "Custom Dimensions" in the Property column. 管理员->选择属性->在“属性”列中向下滚动到“自定义维度”。

But you are not alowed to send data, that can identify a user to GA - this can cause a GA barrier. 但是您不被允许发送可以识别用户加入GA的数据-这可能会导致GA壁垒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM