小编dug*_*ggi的帖子

在使用goog analytics异步代码时,我是否需要在页面上多次调用_gaq.push(['_ trackPageView'])?

我正在使用vanilla ga异步代码,就在结束之前</head>:

<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-xxxxxxx-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>
</head>
Run Code Online (Sandbox Code Playgroud)

现在,稍后在页面中间我打电话:

<script>
_gaq.push(['_setCustomVar',
  1,
  'usertype',
  'anon',
  2
]);
</script>
Run Code Online (Sandbox Code Playgroud)

问题是,我是否需要再次调用_trackPageView?

也就是说,我应该添加另一个

_gaq.push(['_trackPageview']);

...?

google-analytics

5
推荐指数
1
解决办法
4247
查看次数

想要设置ls别名,以获取参数

我的.bashrc中设置了以下别名:

alias la='ls -laG'
Run Code Online (Sandbox Code Playgroud)

但我真的想发出一个命令:

la foo/bar
Run Code Online (Sandbox Code Playgroud)

我想我必须写一个shell脚本?还是有一些xargs方式?

bash

2
推荐指数
1
解决办法
2881
查看次数

标签 统计

bash ×1

google-analytics ×1