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可能解析的内容,您不需要包含它。 –