Analytics
6.8K members online now
6.8K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

GA tracking on click to call in Enhanced Ecommerce Google Analytics

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

I'm trying to implement google analytics tracking for click/tap to call functionality to track Click/Tap to call.

I'm using enhanced ecommerce analytics plugins. 

I have used this code 

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-xxxxxxxx-4', 'auto',{'name':'gaObject'});

 

But I didn't get any related implementation details.

Can you please provide some details about Click/Tap to call tracking, how to implement this tracking.

 

Thanks

 

 

 

 

1 Expert replyverified_user

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Top Contributor
# 2
Top Contributor
Hi, Deepak,

I think that to track click/tap to call, it would require standard event tracking, rather than ecommerce. Is your call tracking associated with ecommerce somehow?

The code you have included is the standard GA tracking code, where you've also created, and named, the GA tracking object, "gaObject" (note that there's really no need to rename your tracker unless you have multiple trackers on the page). With that tracking object, you should be able to implement standard click tracking on the link/element you are interested in tracking.

Would you be able to provide more details about what it is you are trying to track?

Regards.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Nicky Y,

I have used multiple objects for tracking and it's working properly,
Now, I just want to track calls also when I clicke on click/tap to call link.
For that, I have this code:

<a href="tel:8002221111" onclick="_gaq.push(['_trackEvent', 'Mobile', 'Click to Call'])">Click here to call us now at 1-800-222-1111.</a>

It seems that that _gaq.push function if is older one which can not be used with "gaObject" I created.but it gives error to call this function. ( _gaq.push )

I need similar function to push click event using "gaObject".Is there any function available?

Or what else I need to do?

Thanks.
Marked as Best Answer.
Solution
Accepted by topic author Deepak P
January 2016

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Top Contributor
# 4
Top Contributor

Hi Deepak P,

If you are you using Universal Analytics, then the correct onclick code would be

 

onclick="ga('gaObject.send', 'event', 'Mobile', 'Click to Call')"

Hope this helps. 

Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Hi Nicky Y,

Thanks a lot. This answer helped me a lot.

Regards,
Dee

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭
Hi Nicky Y,

I have added following code

I have used this code to create objects :-
&lt;script&gt;
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-16038140-4', 'auto',{'name':'mTrackerU'});
ga('create', 'UA-5570841-1', 'auto', {'name': 'mTracker'});
&lt;/script&gt;

And I have called the function on href as below

<a href="tel:02920707037" id="tapToCallButtonColor" class="newButton ui-link" style="border-radius:0 !important;text-decoration:none;font-weight:bold;"
onclick="ga('mTrackerU.send', 'Product Details', '02920707037', 'Click to Call');
ga('mTracker.send', 'Product Details', '02920707037', 'Click to Call');">
<span id="tapToCallButtonFontColor">Click / Tap to Call</span>
</a>

I have used GA debugger, here all process is working fine for all objects.

Please see this tracking executing Executing Google Analytics commands.
analytics_debug.js:9 Running command: ga("mTrackerU.send", "Product Details", "02920707037", "Click to Call")
analytics_debug.js:9 Executing Google Analytics commands.
analytics_debug.js:9 Running command: ga("mTracker.send", "Product Details", "02920707037", "Click to Call")

Now, I want to check how does it track using Google Analytics Tracking account?
Where can I see its analytics in my google analytics account ?

Thanks

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Top Contributor
# 7
Top Contributor
Hi Deepak,

You need to include the "event" parameter in your onclick code, so that GA knows what kind of hit you are sending. See my code snippet above.

It doesn't look like you are sending in that in with your click: ga('mTracker.send', 'Product Details', '02920707037', 'Click to Call')

Once you have that in place, then you should be able to see the events in the Behaviours > Top Events reports.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭
Hi Nicky Y,

I have put the tracking code as you mentioned above.
Please see the code :-

<a href="tel:${click2CallNumber }" id="tapToCallButtonColor" class="listStrip" style="text-shadow:none;text-decoration:none;font-weight:"
onclick="ga('mTrackerU.send', 'event', 'Mobile', 'Click to Call' );ga('mTracker.send', 'event', 'Mobile', 'Click to Call');">
<span id="tapToCallButtonFontColor">${click2CallText }</span>
</a>

And My google analytics tracking id is UA-72732609-1
I have created new google analytics account ( email is chetan.durafe@avibha.com)
and website is http://localstore.mshopper.net/

But still I'm not able to check where the tracking is done for click to call

I have checked here Behaviours > Top Events reports.

But there is no tracking records.

Can you please check this with above link ( http://localstore.mshopper.net/ )
I have provided click / Tap to call link in footer.

And please provide me the details on this.

Thanks

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Top Contributor
# 9
Top Contributor
Hi Deepak, that link does not work for me. But I would suggest that you install GA Debugger (for Chrome) so that you can see all your gits go through to GA if they are working properly. So what you would do is to have that running, open your developer console, and then click on the link. If it's working, you will see your event hit go through.

The "onclick" code looks fine to me.

Hope this helps.
Nicky Yuen, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here.
Find me on: Google+ | LinkedIn

Re: GA tracking on click to call in Enhanced Ecommerce Google Analytic

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭
Hi Nicky Y,

I have checked it using GA debugger. Here we have send information and we get the response from google debugger as follow :-

Executing Google Analytics commands.
analytics_debug.js:9 Running command: ga("mTrackerU.send", "event", "Mobile", "Click to Call")
analytics_debug.js:9 Executing Google Analytics commands.
analytics_debug.js:9 Running command: ga("mTracker.send", "event", "Mobile", "Click to Call")

You can again check it on link ( http://localstore.mshopper.net/ )
I have provided click / Tap to call link in footer.

please check it once .

Thanks