mrK
mrK

Reputation: 2290

Google Analytics - Event Goal Conversions not tracking

I am trying to implement google analytics and I'm running into a problem where the tracking beacons are being sent, and the conversion goals are not being recorded. What I'm trying to do is show a modal and record whether the modal is submitted or closed. The goal setup I'm using is this:

Category: SignUp
Action: Newsletter
Label: Manual
Value: GreaterThan 1

These are the two things I've tried for the analytics code:

 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'MyAccountNumber']);
  _gaq.push(['_setDomainName', 'MyDomainName']);
  _gaq.push(['_setAllowLinker', true]);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

  function _trackEvent(category, action, label, value, nonInteraction){
    nonInteraction = nonInteraction || false;
    _gaq.push(['_trackEvent', category, action, label, parseInt(value), nonInteraction]);
  };

And this

 (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', 'MyAccountNumber', 'auto');
  ga('send', 'pageview');

  function _trackEvent(category, action, label, value){
    ga('send', 'event', category, action, label, value);
  };

I am calling _track event as such:

_trackEvent('SignUp', 'Newsletter', label, 0);

$('#modalSubmit').click(function() {
  _trackEvent('SignUp', 'Newsletter', 'Manual', 1);
});

As I previously said, the tracking beacons are being sent, but there is no data showing up in the Reporting section. The dates for the report are set to yesterday through tomorrow. Also, if I'm not handling the abandonment rate correctly, what is the correct way to handle this? Thanks in advance!

Upvotes: 0

Views: 1396

Answers (1)

carlodurso
carlodurso

Reputation: 2894

You should only use the universal tracker. It's more accurate.

Make sure you're receiving data then troubleshoot events accordingly. You can check the tracking code status in the Admin section of GA: https://support.google.com/analytics/answer/1008083?hl=en

Google Analytics generally updates your reports every 24 hours, so it can take at least that long for data to appear in your account after you first install the tracking code: https://support.google.com/analytics/answer/1009219?hl=en

Upvotes: 1

Related Questions