Google Analytics事件跟踪代码 [英] Google Analytics Event Tracking code

查看:177
本文介绍了Google Analytics事件跟踪代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google Analytics,在顶层,我可以看到谁来到我的网站,但我无法看到跟踪我社交网络按钮的事件跟踪,我想我可能已经制定了这些错误。



这些事件在我的分析帐户上没有被跟踪,无论如何,如果有人知道他们被保留在哪里,那很棒。



但我使用的代码在下面,因为我不确定是否已经正确实现了这一点:

 < a href =https://twitter.com/share?text=2009:%20Michael%20Jackson%20Dies&hashtags=DIGITL,MichaelJacksontarget =_ blankonClick =_ gaq.push(['_ trackEvent','Social Media','Twitter','Share 2009 Jackson',, false]);>< img src =images / twitter_icon.pngid =2009_michaeljackson_share_twitter alt =在Twitter上分享title =在Twitter上分享>< / a> 

如果有人可以告知这是否正确,那就太好了!



$ h
$ b

根据下面的答案,我删除了在活动概览部分重新测试的双逗号,并且没有出现点击项目...



更新代码示例:

 < li>< a href =#onClick =_ gaq.push(['_ trackEvent','Social Media','Facebook','Share 2003',false]);>< img src =images / facebook_icon.png id =2003_share_fbalt =共享Twitter图标title =在Facebook上分享>< / a>< / li> 

我甚至在Google Analytics中将它们添加为目标,但这似乎也不奏效。

有什么想法? 如果您使用的是旧版GOOGLE分析跟踪功能块,那么以下代码应该可以工作: / p>

 < li>< a href =#onclick =_ gaq.push(['_ trackEvent','Social Media ','Facebook','Share 2003',false]);>< img src =images / facebook_icon.pngid =2003_share_fbalt =分享Twitter图标title =在Facebook上分享 >< / A>< /锂> 

如果您使用的是 NEW GOOGLE UNIVERSAL EVENT TRACKING work:

 < li>< a href =#onclick =ga('send','event' ,'Social Media','Facebook','Share 2003');>< img src =images / facebook_icon.pngid =2003_share_fbalt =分享Twitter图标title =分享到Facebook >< / A>< /锂> 

检查事件是否正确触发非常快速。请执行以下操作; b $ b

2。确保您的IP不会被排除或过滤出analytis配置文件
$ b 3. 登录到您的Google Analytics帐户



4。转到左侧的实时



5。点击活动

> 6。转到您的网站并点击您添加事件代码的链接,然后观察该链接是否显示在实时 - >事件部分。

跳出率讨论

关于大家都在谈论的跳出率。通常,当您添加活动并且有人点击该活动时,Google Analytics会假设用户与您的网站进行了互动,并因此为该网页提供了非常低的跳出率。如果您不希望在放置事件的页面上影响跳出率,则可以在事件结束时添加false。我建议您在尝试调整跳出率之前先完成事件跟踪工作: - )

谢谢,


I'm using Google Analytics, at the top level I can see who has come onto my site, however I cannot see track my event tracking for my social network buttons, I think I may have developed these wrong.

These events are not been tracked on my analytics account that I can see anyway if someone knows where they are kept that would be great.

But the code I've used is below as I'm not sure if I have implemented this correctly:

<a href="https://twitter.com/share?text=2009:%20Michael%20Jackson%20Dies&hashtags=DIGITL,MichaelJackson" target="_blank" onClick="_gaq.push(['_trackEvent', 'Social Media', 'Twitter', 'Share 2009 Jackson',, false]);"><img src="images/twitter_icon.png" id="2009_michaeljackson_share_twitter" alt="Share on Twitter" title="Share on Twitter"></a>

If someone can advise if this is correct will be great!

Update

As per the answer below, I removed the double comma retested in the Events Overview section and no on click items have appeared...

Example of updated code:

<li><a href="#" onClick="_gaq.push(['_trackEvent', 'Social Media', 'Facebook', 'Share 2003', false]);"><img src="images/facebook_icon.png" id="2003_share_fb" alt="Share Icon for Twitter" title="Share on Facebook"></a></li>

I've even added them as a goal in Google Analytics but this doesn't seem to work either.

Any ideas?

解决方案

If you are using the OLD GOOGLE ANALYTICS TRACKING BLOCK, then the below should work:

<li><a href="#" onclick="_gaq.push(['_trackEvent', 'Social Media', 'Facebook', 'Share 2003', false]);"><img src="images/facebook_icon.png" id="2003_share_fb" alt="Share Icon for Twitter" title="Share on Facebook"></a></li>

If you are using the NEW GOOGLE UNIVERSAL EVENT TRACKING code the below will work:

<li><a href="#" onclick="ga('send', 'event', 'Social Media', 'Facebook', 'Share 2003');"><img src="images/facebook_icon.png" id="2003_share_fb" alt="Share Icon for Twitter" title="Share on Facebook"></a></li>

To check whether the events are firing correctly VERY QUICKLY. Do the following;

1. Make sure you update the code on your site and make it live

2. Make sure your IP is not excluded or filtered out of the analytis profile

3. Login to your google analytics account

4. Go to Real-Time section on the left hand sidebar.

5. Click on Events

6. Go to your site and click on the link you added the event code to and then watch if that link shows up in the real-time -> events section.

Bounce Rate Discussion

About the bounce rate everyone is talking about. Usually when you add an event and someone clicks on it, then google analytics will assume that user interacted with your site and therefore provide a very low bounce rate for that page. If you don;t want the bounce rate to be affected on the page where the event is placed, then you can add the false at the end of the event. I would suggest you get the event tracking working, before trying to adjust the bounce rates :-)

Thank you,

这篇关于Google Analytics事件跟踪代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆