Mobile app version of vmapp.org
Login or Join
Karen161

: Why can't I get event tracking to work with Google Analytics I have Google Analytics working and can see everything happen in realtime. I can't however get the events to fire when people click

@Karen161

Posted in: #EventTracking #GoogleAnalytics

I have Google Analytics working and can see everything happen in realtime. I can't however get the events to fire when people click on the apps to download them. (they actually go to a email signup form at the moment)

I think I'm using UA and used the right syntax so I am absolutely stuck. I also have to make the HTML changes via a third party which means I can't do a kill the problem via iteration approach.

Here's the GA script which is just before the closing body tag

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

ga('create', 'UA-65638907-1', 'auto');
ga('send', 'pageview');
</script>


and here's the tracking code

<ul class="list-unstyled download-buttons">
<li class="app-store"><a href="http://eepurl.com/bsdWGr" target="blank" onClick="ga('send', 'event', 'AppStore', 'Click', 'iOS Download', 10);"><img class="img-responsive" src="assets/images/buttons/btn-app-store.png" alt="Download from App Store" /></a></li>
<li class="google-play"><a href="http://eepurl.com/bsdWGr" target="blank" onClick="ga('send', 'event', 'AppStore', 'Click', 'Android Download', 10);"><img class="img-responsive" src="assets/images/buttons/btn-google-play.png" alt="Download from Google Play" /></a></li>
<li class="windows-store"><a href="http://eepurl.com/bsdWGr" target="blank" onClick="ga('send', 'event', 'AppStore', 'Click', 'Windows Phone Download', 10);"><img class="img-responsive" src="assets/images/buttons/btn-windows-store.png" alt="Download from Windows Phone Store" /></a></li>
</ul><!--//list-unstyled-->

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Karen161

1 Comments

Sorted by latest first Latest Oldest Best

 

@Bryan171

I solved it. It seemed to be a combination of things


bad code - there were 2 instances of what I wanted to track displaying on the page but 3 in the code and I didn't spot it.[Bad code in this case being synonymous with poor user skill base ;]
2 GA scripts on the same page
Working with the wrong UA account


On the upside I know a LOT more about GA troubleshooting now :)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme