Work
About
Contact

Avoiding Duplicate or Double Counted Goals in Google Analytics

November 28, 2012   |   Tech
Agile League

I was finding some discrepancy in my Google Analytics user signup goals, where the number of new signups listed in the goal were higher than what I was seeing in my database. While investigating, I found that there were certain “popular” URLs generating a good chunk of the overall conversions. Ultimately what I learned is that people were bookmarking the post-signup page that included the Google Analytics goal parameters. Every time they would follow their bookmark, it would generate another goal conversion, meaning I was counting some people hundreds of times. I struggled with this a bit and came up with two solutions.

The “worthless” confirmation page

One solution would be to make the post-signup confirmation page not worth bookmarking. Perhaps it just says, “Thanks! Taking you to your profile!” or “Here’s a funny cat video to thank you for signing up!” The basic goal is for their browser to load a page with the Google Analytics tracking params and then have the user never bookmark or return there.
I really dislike this idea for a few reasons. First, it seems like a bad user experience right from the start. The first thing you do to your brand new user is waste their time. Second, it doesn’t really solve the problem, since they can still bookmark and return the page as much as they want, you’re just making it less likely. Finally, you have to create a brand new page, which is non-trivial, especially since you’re trying to make a good experience for a brand new user.

The session hack

The solution I eventually chose was to put a flag in the user session after they first signup. Then, on the page with the GA goal parameters, the server checks for that session flag. If there, it deletes it from the session and loads the page. If not, the server redirects them back to the same page with the GA goal parameters stripped.
The flag is always there immediately after they sign up, and then it is deleted and never seen again, meaning exactly one page load occurs with the GA goal parameters. This is a simple and elegant solution, and is a snap to implement…assuming you understand sessions and can monkey with them like this. If you’re in Rails it’s a 10 minute change.

A better way?

Overall, both solutions seem a little clunky, and surely there must be a better way to do it. If there are any Google Analytics experts out there who want to set me straight, please leave a comment and I’ll update the post.