2K 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

Event Tracking

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi guys

I'm trying event tracking for the first time on a phone number and can't seem to get it to work.

 

Events (clicks) are not logged in either Real Time > Events dashboard or  Behaviour > Events > Overview

 

Here's my code:

 

<a href="tel:0123456" onclick="”ga(‘send’," ‘event’,="" ‘contact’,="" ‘click’,="" ‘phone="" icon="" in="" nav’);”="">
Call Us
</a>

I have Google Analytics (Universal Analytics) successfully setup. Is there something else I need to implement?

Here's my Google Analytics script - I've removed the UA ID 

<script>
  (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','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXX-1', 'auto');
  ga('send', 'pageview');

</script>

Thanks guys

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Peter K
July 2016

Re: Event Tracking

Top Contributor
# 4
Top Contributor

Hi Peter,

 

The quotation marks are different in your code and it is not working because of that. Please use the code below:

 

<a href="tel:00442036370700" onClick="ga('send', 'event', 'Contact', 'Click', 'Phone Icon in Nav');">Call Us</a>

 

Hope this helps.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

View solution in original post

Re: Event Tracking

Top Contributor
# 2
Top Contributor

 Hi Peter,

 

Your event tracking code snippet is incorrect, you need to change it so it looks like this:

<a href="tel:0123456" onclick="ga('send', 'event', 'Phone Number', 'Clicked', 'Header');">
Call Us
</a>

You can change the category / action / label, the above is just an example.

Hope this helps.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Event Tracking

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Arnold M wrote:

 Hi Peter,

Your event tracking code snippet is incorrect, you need to change it so it looks like this:

<a href="tel:0123456" onclick="ga('send', 'event', 'Phone Number', 'Clicked', 'Header');">
Call Us
</a>

You can change the category / action / label, the above is just an example.

Hope this helps.

 

Hey Arnold

It looks like my example became mis formatted when I pasted it into this forum.

 

Here's the code I am using which looks exactly as your specifies. Still doesn't work though Smiley Sad

 

<a href="tel:00442036370700" onClick=”ga(‘send’, ‘event’, ‘Contact’, ‘Click’, ‘Phone Icon in Nav’);”>Call Us</a>
Marked as Best Answer.
Solution
Accepted by topic author Peter K
July 2016

Re: Event Tracking

Top Contributor
# 4
Top Contributor

Hi Peter,

 

The quotation marks are different in your code and it is not working because of that. Please use the code below:

 

<a href="tel:00442036370700" onClick="ga('send', 'event', 'Contact', 'Click', 'Phone Icon in Nav');">Call Us</a>

 

Hope this helps.


Arnold Majlath, Google Analytics Top Contributor
Was my response helpful? If yes, please accept it as solution.
Circle Me On Google+ | Visit me @ Redfly Digital

Re: Event Tracking

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Many thanks Arnold. Working great now Smiley Happy

Event Tracking

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Sorry, to reopen this thread. As I'm also facing similar kind of issue.

I have created Event Tracking code for one of the form on my website, but it doesn't reflecting in my GA dashboard. 

 

Here is the button event tracking code.

<button id="pwebcontact3_send" type="button" onclick="ga('send', 'event', { eventCategory: 'form', eventAction: 'submit', eventLabel: 'SUBMIT YOUR REQUEST'});" class="btn pweb-button-send" data-role="none">SUBMIT YOUR REQUEST</button>

 

Waiting for reply.

 

Thanks.