![](/img/trans.png)
[英]Leveraging Measurement Protocol to connect Google Analytics to CRM
[英]Google Analytics Screen Time Incorrect when using Measurement Protocol
我正在為我的Tizen TV應用程序使用測量協議,因為我不能使用JS(需要域名)或Android / iOS SDK。
我發送
{
v: 1,
tid: GA_TRACKING_ID,
cid: data.deviceId,
t: 'screenview',
dh: 'something.com',
dp: encodeURIComponent($location.path()),
cd: transition.to().title + ($stateParams.gaTitle ? ' (' + $stateParams.gaTitle + ')' : '') || 'Unknown',
an: 'XXX',
'ga:mobileDeviceModel': data.deviceModel
}
要https://www.google-analytics.com/collect
但屏幕時間似乎總是在幾秒鍾之內。 30s等我測試了很長一段時間在頁面上停留但似乎沒有正確反映。 我猜它是因為我只發了一次這個命中,谷歌沒辦法知道它何時停止? 有沒有辦法來解決這個問題?
首先,您需要決定會話超時(Admin-> property-> tracking.js),默認值為30分鍾意味着您需要以30分鍾之間的間隔生成匹配,以防止新的匹配進入新會話。
然后你需要確保點擊頻率足夠頻繁並包括他們當前的頁面/屏幕名稱,例如:
{ // start video
v: 1,
tid: GA_TRACKING_ID,
cid: data.deviceId,
t: 'screenview',
dh: 'something.com',
dp: encodeURIComponent($location.path()),
cd: transition.to().title + ($stateParams.gaTitle ? ' (' + $stateParams.gaTitle + ')' : '') || 'Unknown',
an: 'XXX',
'ga:mobileDeviceModel': data.deviceModel
}
{ // < 30 minutes later
v: 1,
tid: GA_TRACKING_ID,
cid: data.deviceId,
t: 'event',
ec: 'Inactivity',
ea: 'Watching Video',
el: ..video name..,
ev: 28,
ni: 0, // count as interaction, ni=1 are ignored in time calculations
dh: 'something.com',
dp: encodeURIComponent($location.path()),
cd: transition.to().title + ($stateParams.gaTitle ? ' (' + $stateParams.gaTitle + ')' : '') || 'Unknown',
an: 'XXX',
'ga:mobileDeviceModel': data.deviceModel
}
{ // user does something (can wait 30 minutes more before a new ni event)
v: 1,
tid: GA_TRACKING_ID,
cid: data.deviceId,
t: 'event',
ec: 'Activity',
ea: 'Volume Adjustment Down',
el: ..video name..,
ev: 5,
ni: 0,
dh: 'something.com',
dp: encodeURIComponent($location.path()),
cd: transition.to().title + ($stateParams.gaTitle ? ' (' + $stateParams.gaTitle + ')' : '') || 'Unknown',
an: 'XXX',
'ga:mobileDeviceModel': data.deviceModel
}
{ // user goes to new screen (also calculated as the end of screen time)
v: 1,
tid: GA_TRACKING_ID,
cid: data.deviceId,
t: 'screenview',
dh: 'something.com',
dp: encodeURIComponent($location.path()),
cd: 'somewhere else',
an: 'XXX',
'ga:mobileDeviceModel': data.deviceModel
}
如果您能夠發送所有退出事件,那么您可能希望在退出時(或每4小時)使用隊列時間來計算該期間的所有數據所在的會話。
Google Analytics的會話計算基於用戶的互動。 如果用戶單擊,會話將獲得心跳。 如果用戶正在觀看電影(例如電視),則它不會與您的應用程序交互並且會話停止
看看這個頁面https://www.optimizesmart.com/understanding-sessions-in-google-analytics/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.