1
我是新來的谷歌分析自定義變量。我不明白如何從用戶中獲取會話/發佈變量。如何報告Google分析中的會話變量?
我試圖捕獲$_SESSION['usercountry']
並將其添加到GA數據中。它只顯示用戶註冊的國家。
從GA
_gaq.push(['_setCustomVar',
2, // This custom var is set to slot #2. Required parameter.
'Country', // The name of the custom variable. Required parameter.
'???', // The value of the custom variable. Required parameter.
// (you might set this value by default to No)
2 // Sets the scope to session-level. Optional parameter.
]);
難道我只是把usercountry在我的問號?
感謝您的幫助。我看了大約20個教程,並沒有看到這些值是如何通過的,因爲GA不知道用戶國家是什麼。將測試它並尋找結果。 – blankip
這是一個字符串。爲什麼「var userCountry =」Country Name「; required? – blankip
@DavidMoore」Country Name「僅僅是前面代碼片段中PHP輸出的一個例子,JavaScript可能解析的內容,您不需要包含它。 –