©2009 Google -
Code Home -
Terms of Service -
Privacy Policy -
Site Directory
Google Code offered in:
English -
Español -
日本語 -
한국어 -
Português -
Pусский -
中文(简体) -
中文(繁體)
This reference describes the methods that you use for setting up and customizing campaign tracking in Google Analytics reporting.
_setAllowAnchor(bool)_setCampContentKey(newCampContentKey)_setCampMediumKey(newCampMedKey)_setCampNameKey(newCampNameKey)_setCampNOKey(newCampNOKey)_setCampSourceKey(newCampSrcKey)_setCampTermKey(newCampTermKey)_setCampaignTrack(bool)_setCookieTimeout(newDefaultTimeout)_setReferrerOverride(newReferrerUrl)_setAllowAnchor(bool)
false by default. Typically, campaign
tracking URLs are comprised of the question mark (?) separator and the
ampersand (&) as delimiters for the key/value pairs that make up the
query. By enabling this option, your campaign tracking URLs can use a
pound (#) sign instead of the question mark (?).
http://mysite.net/index.html?source=In+House#method=email#offer_type=Fall+email+offers pageTracker._setAllowAnchor(true);
Boolean true or false If
this parameter is set to true, then campaign uses anchors.
Otherwise, the campaign uses search strings.
_setCampContentKey(newCampContentKey)
http://mysite.net/index.html?source=giganoshopper.com&method=referral&offer_type=Christmas+specials&description=Garden+gloves
pageTracker._setCampContentKey("description");
String newCampContentKey New campaign content
key to set.
_setCampMediumKey(newCampMedKey)
http://mysite.net/index.html?source=giganoshopper.com&method=ad&offer_type=Christmas+specials&description=Garden+gloves
pageTracker._setCampMediumKey("method");
String newCampMedKey Campaign medium key
to set.
_setCampNameKey(newCampNameKey)
http://mysite.net/index.html?source=In+House&method=email&offer_type=Fall+email+offers
pageTracker._setCampNameKey("offer_type");
String newCampNameKey Campaign name key.
_setCampNOKey(newCampNOKey)
http://mysite.net/index.html?source=giganoshopper.com&method=referral&offer_type=Christmas+specials&description=Garden+gloves&noo=1234
pageTracker._setCampNOKey("noo");
String newCampNOKey Campaign no-override
key to set.
_setCampSourceKey(newCampSrcKey)
http://mysite.net/index.html?source=giganoshopper.com&method=referral&offer_type=Christmas+specials&description=Garden+gloves
pageTracker._setCampSourceKey("source");
String newCampSrcKey Campaign source key
to set.
_setCampTermKey(newCampTermKey)
http://mysite.net/index.html?source=weSearch4You.com&method=paidSearchAd&offer_type=Christmas+specials&description=Garden+gloves&term=garden+tools
pageTracker._setCampTermKey("term");
String newCampTermKey Term key to set.
_setCampaignTrack(bool)
true for
standard Google Analytics set up. If you wish to disable campaign tracking
and the associated cookies that are set for campaign tracking, you can
use this method.
Boolean true or false True
by default, which enables campaign tracking. If set to false,
campaign tracking is disabled.
_setCookieTimeout(newDefaultTimeout)
pageTracker._setCookieTimeout("3152600"); //number of seconds in 1 year
String newDefaultTimeout New default cookie
expiration time to set. Pass in as a string and it is converted to an
integer.
_setReferrerOverride(newReferrerUrl)
document.referrer property to determine
the referrer URL, which is passed in the utmr parameter of the GIF request.
However, you can over-ride this parameter with your own value. For example, if
you set the new referrer to http://www.google.com/search?hl=en&q=hats,
the campaign cookie stores a new campaign with source=google,
medium=organic, and keyword=hats.
String newReferrerOverride The new url for
the document referrer.