[英]how do i display user-data and user-id in google analytics report
我已在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>
這是我使用的代碼
在“受眾群體”標簽中應用此代碼后,用戶瀏覽器仍顯示ClientId,但未顯示userId。
我還想在報告中獲取用戶自定義數據,例如其名稱,電子郵件等,因為它們已經創建了自定義維度,現在正在發送硬編碼值,但是它沒有顯示在任何地方?
您必須先在Google Analytics(分析)后端中設置UserID函數,然后才能使用它:
自定義尺寸似乎也存在相同的問題。 如果您將自定義維度(或自定義指標)發送到GA,則首先必須在GA后端中設置維度(或指標):
管理員->選擇屬性->在“屬性”列中向下滾動到“自定義維度”。
但是您不被允許發送可以識別用戶加入GA的數據-這可能會導致GA壁壘。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.