Javascript 登录网站后如何跟踪用户?
下面是跟踪有多少客人访问了我的页面的代码Javascript 登录网站后如何跟踪用户?,javascript,google-analytics,google-analytics-api,Javascript,Google Analytics,Google Analytics Api,下面是跟踪有多少客人访问了我的页面的代码 <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-18841631-1']); _gaq.push(['_setCustomVar',1,'Status','Logged-in',1]); _gaq.push(['_trackPageview']); (funct
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18841631-1']);
_gaq.push(['_setCustomVar',1,'Status','Logged-in',1]);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
var _gaq=_gaq | |[];
_gaq.push([''设置帐户','UA-18841631-1']);
_gaq.push([''u setCustomVar',1,'Status','Logged-in',1]);
_gaq.push([''u trackPageview']);
(功能(){
var ga=document.createElement('script');ga.type='text/javascript';ga.async=true;
ga.src=('https:'==document.location.protocol?'https://ssl' : 'http://www“)+”.google analytics.com/ga.js';
var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(ga,s);
})();
登录网站后如何跟踪用户
要在登录后跟踪用户,所有步骤都必须遵循..请指导我..用户登录后跟踪的最佳方法是会话。用户成功登录后,只需根据您的需要创建和维护会话变量。I在会话中维护。如果登录成功,则表示_setcustomvar中的值应更改为“已登录”,否则应更改为“已注销”