开发者

Combining two Google Analytics scripts

I´m trying to combine two Google Analytics scripts, _trackEvent and _trackPageview. My questions is, how do I write this in one single script?

This works fine

<a href="www.link.com" onClick="_gaq.push(['_trackEvent', 'Button', 'Category', 'Product']);"Text</a> 

Now I need to add following script below:

<a href="www.link.com" onClick="pageTracker._trackPageview(‘/virtual/page/productA’);">Text</a>

Does anyone have a working solution for this?

Thanks in advance!


See my code below, an event is created correctly in Google Analytics, also a content page is created, example "/virtual/products/abc", but it dosen´t effect goal tracking in GA at all, which is odd.

If I remove _trackEvent code, th开发者_C百科e _trackPageview works, so I guess Im still struggling how to combine this two Analytics events with HTML correctly.

<a href="url" target="_blank" onClick="_gaq.push(['_trackEvent', 'Button', 'Category', 'Product', 100]); _gaq.push(['_trackPageview','/virtual/products/abc/']);">Link text</a>

Thanx in advance, /Fredrik


One Push, Multiple Commands

_gaq.push(['_trackEvent', 'Button', 'Category', 'Product'],['_trackPageview', ‘/virtual/page/productA’]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜