Google Analytics Goals – Event or URL Based?
Lots of people ask whether Goals in Google Analytics should be event based or URL based. It really depends on the situation.
Here’s a framework for thinking about it: (above, the event based goal configuration control panel)
IF – the goal can be defined by a loading of a real URL in the browser and you can match the URL via regular expressions or a simpler match (head, which ignores query params or exact, which is well…exact) then use a URL definition
IF – the goal can be defined by feeding a virtual pageviews into the trackPageview method, because you want to modify or customize the actual URL in the web browser, then use a URL definition. Here’s an example: pretend the true URL is yoursite.com/register/complete, but you want to see the username in GA, too.
_gaq.push(['_setAccount', 'UA-12345-1']);
_gaq.push(['_trackPageview', '/register/complete/jeffjames83']);
// this would allow you positively modify what GA thinks the URL is
IF – the goal is defined by something that’s basically unrelated to a pageview, like the completion of a video, or an attempt to access a PDF which does not execute javacsript, then using an event based goal is the right way to go. You leave pageviews alone.
Drawback of event based goals – you can’t create funnels. Note that while you can easily set-up the URL based goal, in order to properly configure the event based goal you must know the paramaterization of the custom event. In the image above, you can see the category, action, label and value. The category and action must be populated while the label and value are optional. Here’s an example of a custom event:
gaq.push(['_trackEvent', 'Google Analytics Consultant', 'Contact', 'Implementation Help']); // shameless self promote!
There are some grey areas, like infinite scroll (think Twitter, Facebook Walls, Pinterest, etc..). When people scroll to the equivalent of page 2′s results…is this a pageview or is it not? For consistency I would argue that it is, especially if you’re moving from traditional pagination to infinite scroll; otherwise I would really think hard about somehow tracking progress into the scroll whether through virtual pageviews or events.
You know what they say about goals – “shoot for the stars and even if you hit the moon…you saved on airfare?”
Jeff

3 comments + Add a comment
Greg Sobiech
June 4, 2012 at 12:55 pm
Jeff, Great post as always!
Gunjan Aggarwal
June 6, 2012 at 5:11 am
Very helpful post!!!
V Jeffrey James
June 7, 2012 at 9:22 am
Thanks Gunjan glad it was eventful for you.