Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The web application I built throws errors when presented with unknown query string variables, so I'd like to manually set the tracking values manually, much like:


But by setting the values directly, not the variables to look for the values in.

Is this possible?

share|improve this question

Perhaps you could play around with other options such as _setAllowAnchor() and change your URLs to use hashes (for GA) and query vars for your web app. Although, to be honest, probably not the best idea in the world to throw errors if you have unknown variables query strings, it should just ignore them instead.

share|improve this answer

No, it is not possible. In order for Google Adsense to recognize the data, it needs to be in the URL as a GET variable, otherwise it doesn't know where to look.

share|improve this answer

You can pass custom values onto the GA tracking using

_gaq.push(['_setCampSourceKey', 'source']);

and the equivalent for medium, campaign, etc.


share|improve this answer

Check out this: http://blog.intlock.com/_setcampvalues-for-google-analytics/

Here the utmz cookie is faked with Javascript, hence you can problematically specify the source, medium, ...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.