Mobile app version of vmapp.org
Login or Join
Heady270

: Google Analytics - How to track sign ups through events? I'm tyring to track sign ups as goals, however I have 3 different types of accounts to track so just using the 'registered.html' page

@Heady270

Posted in: #GoogleAnalytics

I'm tyring to track sign ups as goals, however I have 3 different types of accounts to track so just using the 'registered.html' page as a goal isn't going to do. So therefore I need to use events, why GA requires you to do this is absolutely beyond me. The goal feature is so weak....

Anyway, I'm trying to track events and absolutely nothing I'm doing seems to be working.

I've tried loading it onto a transparent pixel as follows:

<img src="{{ url('img/1x1.png') }}" onload="_gaq.push(['_trackEvent', 'Sign Up', 'Designer Sign Up', '',, false]);" />


That doesn't work. And I've also tried putting the push event in

$(document).ready(function(){

});


to no avail.

If anyone could help me set up this simplest of tracking features I'd be so appreciative.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Heady270

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sims2060225

There are a couple ways you can do this...with and without events...

1) One route you can take is changing the tracking code on registered.html to send a different URL into GA. I'm not sure your code setup or if you have the ability to alter tracking code page-by-page. How this works is you have an if/else check, as in "if account type is x, show y alteration to the GA tracking script". For each account type you assign a different URL using GA's "set":

ga('set', 'page', '/registered-whateveraccounttype.html');


The "set" code needs to fire after "create" and before "send", which is why you need to alter the code page-by-page. You would then set /registered-whateveraccounttype.html (or whatever the virtual URL is) as your goal page.

2) Going the event route, you'd want to send the GA event on form submit. The easiest way to do this is going to put the event tracking on form submit. You could then get the account type field and pass it along with the event. Using jQuery that could look something like this:

$( "#signup_form" ).submit(function( event ) {
var accountType = $( "select.accounttype" ).val();
ga('send', 'event', 'form', 'signup',accountType);
});


You can then setup the event as a goal (http://www.blastam.com/blog/index.php/2011/03/how-to-use-events-goals-google-analytics and www.lunametrics.com/blog/2011/04/12/events-goals-google-analytics/ are good resources for this).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme