Google Event tracking for phone number

心不动则不痛 提交于 2019-11-30 00:38:42

问题


I am running a WordPress site, which is verified with Google Webmaster Tools and has a GA code associated with Google Analytics.

I've done some research on the web to add an Event tracker for clickable phone numbers in mobile, so that I can measure how many people actually use the phone number on the homepage of the website we developed for a client: posanarestaurant.com.

Most of the blogs that offered up how to do this simply gave me this code to add to my site below:

<a href="tel:18285053969" onclick="_gaq.push(['_trackEvent','Phone Call Tracking','Click/Touch','Home Banner']);">828.505.3969</a>

They said that Google would start to pick up tracking in 24 to 48-hours, but I haven't seen anything in GA yet.

I know that there is some javascript that might go in the head of the site, but one of the plugins I'm using already adds that javascript, so I don't want to duplicate having two exact same javascript references in the head of the site.

What am I doing wrong?


回答1:


The syntax for UA event tracking is

ga('send', 'event', 'Phone Call Tracking', 'Click/Touch', 'Home Banner')

So your complete code would be

<a href="tel:18285053969" onclick="ga('send', 'event', 'Phone Call Tracking', 'Click/Touch', 'Home Banner');">828.505.3969</a>

Once you have that set, and if you are not filtering out your own views, you can check for the event hit in Real-Time reports (so you don't have to wait 24 hours to see if it's working).



来源:https://stackoverflow.com/questions/28848203/google-event-tracking-for-phone-number

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