_setCampNameKey usage in Google Analytics

假如想象 提交于 2019-12-12 02:22:20

问题


I'm looking at the js for google analytics on a page. It contains the following (changed the domain name, name etc). This is on the home page. I understand that these are used to set campaign variables but... why would someone do this on the home page? Perhaps because they have multiple sites and are tracking hits to each one as a campaign? Is this a good configuration?

 _gaq.push(['_setDomainName', 'somesite.co.uk']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_setCampNameKey', 'John Doe']);
  _gaq.push(['_setCampSourceKey', 'any']);
  _gaq.push(['_setCampMediumKey', 'any']);
  _gaq.push(['_setCampTermKey', 'plumbs']);
  _gaq.push(['_setCampContentKey', 'all']);
  _gaq.push(['_trackPageview']);

回答1:


You're thinking a step further. All the _setCamp*Key functions tell GA there to look in the Key -- not the value. Take a closer look at the examples in the GA Campaign Tracking Docs



来源:https://stackoverflow.com/questions/15697112/setcampnamekey-usage-in-google-analytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!