Analytics
1.1K members online now
1.1K 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

Google Analytics Event Tracking commands not working

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Greetings, everyone!

 

I'm implementing an event tracking mechanism on a website, and I'm unable to find a way to make it work, even when following all the guidelines.

 

Before going into detail, I've added the basic tracking code that Google provides before the rest of the body's code:

 

<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-58945544-1', 'auto');


ga('send', 'pageview');

 

</script>

 

Now, in a test-page that I'm using, I have two hyperlinks (one in a form of a button, and another one in the form of text) that download the same version of a software, and I want to track an Event when the user clicks both of these hyperlinks to download the version. For that, I've incorporated in the "<a></a>" case the following command for them both:

 

onclick="ga('send', 'event', ‘Versions', ‘Download', ‘Demo’);"

 

The things is, I'm not getting any event tracking log on the my Analytics board from the both of them... why is that?

 

 

Regards!

1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Ricardo Sousa
July

Google Analytics Event Tracking commands not working

Participant ✭ ✭ ☆
# 6
Participant ✭ ✭ ☆

Hi @Ricardo Sousa,

 

Ok, I found the problem. It is because of the quote character that you have on your event command.

You have: ga('send', 'event', ‘Versions', ‘Download', ‘Demo’);  (‘) character is different than  this one (') and please use this one while coding(')

 

If you replace your current Google Analytics event command with the following one, it will start to work immediately.

ga('send', 'event', 'Versions', 'Download', 'Demo');

 

I hope your problem is solved now.

Regards

 

View solution in original post

Google Analytics Event Tracking commands not working

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

Hi @Ricardo Sousa,

 

You are on the right track. Normally, it should work. The issue might be related to your Google Analytics view's filters. If you are blocking your ip address, you will not be able to see the events..

 

Can you please share your page's URL with us? I can take a look for you.

 

Regards,

Güney

Google Analytics Event Tracking commands not working

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi!

 

Where can I:

 

1. Find if any filters are applied to the website; and

2. How and where can I know if the IP address is being blocked?

 

 

Regards,

Ricardo.

Google Analytics Event Tracking commands not working

Participant ✭ ✭ ☆
# 4
Participant ✭ ✭ ☆

Please navigate to 'Admin' ->  'Filters' (Under view section). You will see your filters there and IP address filter will be there if you have one.

In order to find the actual reason of your problem, we need to take a look at your website.

 

Regards,

Güney

Google Analytics Event Tracking commands not working

[ Edited ]
Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

No filters are available there, so this is even more odd...

 

Also, we found out that the page was included on the "Referral Exclusion List", in the page's "Tracking Info", but deleting it from there didn't solve the problem...

 

The test-page we are using to test the tracking code is this one: http://www.soundparticles.com/versions_2.html

 

The elements that have the 'ga' code are the "Download" button and the "here" hyperlink ("Download the current version here."), both in the "Sound Particles Demo" section. Feel free to inspect to find the associated code.

Marked as Best Answer.
Solution
Accepted by topic author Ricardo Sousa
July

Google Analytics Event Tracking commands not working

Participant ✭ ✭ ☆
# 6
Participant ✭ ✭ ☆

Hi @Ricardo Sousa,

 

Ok, I found the problem. It is because of the quote character that you have on your event command.

You have: ga('send', 'event', ‘Versions', ‘Download', ‘Demo’);  (‘) character is different than  this one (') and please use this one while coding(')

 

If you replace your current Google Analytics event command with the following one, it will start to work immediately.

ga('send', 'event', 'Versions', 'Download', 'Demo');

 

I hope your problem is solved now.

Regards

 

Google Analytics Event Tracking commands not working

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

@Güney K

 

That was, in fact, the issue! What a silly problem! Thank you very much for finding out the issue! 

 

Regards,

Ricardo.

Google Analytics Event Tracking commands not working

Participant ✭ ✭ ☆
# 8
Participant ✭ ✭ ☆

Smiley Happy You're welcome and happy to help!

By the way, you have an interesting product.

 

Regards,

Güney

 

 

Google Analytics Event Tracking commands not working

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

@Güney K, thank you for your comments, but this is not my product, it's by Nuno Fonseca. But your comments is valued nonetheless!

Google Analytics Event Tracking commands not working

[ Edited ]
Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Hi,

 

Our google analytics is working fine except the search tracking. The search feature is not being tracked by GA. Here is the link of our website: <edited by a Community Manager as noted below>

 

<edited by a Community Manager as noted below>