So we just relaunched our site as a Backbone powered single-paged app, but we’re having a heck of a time tracking our conversions from our AdWords ads into the site with Google Analytics.
The problem is that in order for Google Analytics to track the fact that the user came in from AdWords, it looks for a URL query parameter called gclid in the URL:
http://test.com/?gclid=(Q#kjsdf0INKJSDJF9
But, when the Router from Backbone initializes, it removes all the query parameters from the URL, so when the tracking event fires, it doesn’t see that the user came from an AdWords ad.
We tried sending the user to an interstitial page that loads the analytics code and waits for the event to fire and then forwards them into the site, but
- Its ugly and shows users a blank page for a while
- Doesn’t work without a significant wait for IE8 users (who make up 50% of our user base sadly)
We contacted Google’s AdWords help to see if we can manually give the gclid to Analytics and their answer was
You should hire one of our consultants who will figure out how to keep the URL parameters on your site so it works correctly because we do not support manually setting the
gclidID
(Sadly only a very minor paraphrase.)
Google-fu leaves me blank in this respect — lots of people asking questions in the Google forums, but no answers.
I don’t know how everything is setup, but Backbone might not be seeing that URL with the parameters as a match, or a route that it knows about. In fact, you can test that by doing something like…
If you wanted just a simple way to match routes with params, here’s two ways that you could do it.