This reference contains all of the available methods that you can use to customize data configuration for Google Analytics reporting.
_addIgnoredOrganic(newIgnoredOrganicKeyword)_addIgnoredRef(newIgnoredReferrer)_addItem(Item, sku, name, category, price, quantity)_addOrganic(newOrganicEngine, newOrganicKeyword)_addTrans(orderId, affiliation, total, tax, shipping, city, state, country)_clearIgnoredOrganic()_clearIgnoredRef()_clearOrganic()_cookiePathCopy(newPath)_createEventTracker(objName)_getAccount()_getClientInfo(1)_getDetectFlash(1)_getDetectTitle(1)_getLocalGifPath()_getServiceMode()_getVersion()_initData()_link(targetUrl, useHash)_linkByPost(formObject, useHash)_setAllowAnchor(enable)_setAllowHash(enable)_setAllowLinker(enable)_setCampContentKey(newCampContentKey)_setCampMediumKey(newCampMedKey)_setCampNameKey(newCampNameKey)_setCampNOKey(newCampNOKey)_setCampSourceKey(newCampSrcKey)_setCampTermKey(newCampTermKey)_setCampaignTrack(enable)_setClientInfo(enable)_setCookiePath(newCookiePath)_setCookieTimeout(newDefaultTimeout)_setDetectFlash(enable)_setDetectTitle(enable)_setDomainName(newDomainName)_setLocalGifPath(newLocalGifPath)_setLocalRemoteServerMode()_setLocalServerMode()_setRemoteServerMode()_setSampleRate(newRate)_setSessionTimeout(newTimeout)_setVar(newVal)_trackEvent(action, opt_label, opt_value) _trackPageview(opt_pageURL)_trackTrans()_addIgnoredOrganic(newIgnoredOrganicKeyword)pageTracker._addIgnoredOrganic("www.mydomainname.com");
String newIgnoredOrganicKeyword Keyword search terms to treat as direct traffic.
_addIgnoredRef(newIgnoredReferrer)pageTracker._addIgnoredRef("www.sister-site.com");
String newIgnoredReferrer Referring site to exclude.
_addItem(Item, sku, name, category, price, quantity)pageTracker._addItem( "343212", //order ID "DD4444", //sku "Lava Lamp", // product name "Decor", // category or product variation "34.99", // price "1" //quantity );
String Item
String sku Item's SKU code (required).
String name Product name.
String category Product category.
String price Product price (required).
String quantity Purchase quantity (required).
_addOrganic(newOrganicEngine, newOrganicKeyword)String newOrganicEngine Engine for new organic source.
String newOrganicKeyword Keyword name for new organic source.
_addTrans(orderId, affiliation, total, tax, shipping, city, state, country)_addItem(),
this method handles only transaction tracking and provides no additional ecommerce
functionality. Therefore, if the transaction is a duplicate of an existing
transaction for that session, the old transaction values are over-written with the
new transaction values.pageTracker._addTrans(
"1234", //order ID - required
"My Partner Store", //affiliation or store name
"84.99", //total - required
"7.66", //tax
"15.99", //shipping
"Boston", //city
"MA", //state or province
"USA" //country
);
String orderId Internal unique order id number for this transaction.
String affiliation Optional partner or store affiliation. (undefined
if absent)
String total Total dollar amount of the transaction.
String tax Tax amount of the transaction.
String shipping Shipping charge for the transaction.
String city City to associate with transaction.
String state State to associate with transaction.
String country Country to associate with transaction.
_gat.GA_EComm_.Transactions_ The tranaction object that was
modified.
_clearIgnoredOrganic()_clearIgnoredRef()_clearOrganic()_cookiePathCopy(newPath)_initData() must be called).var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._cookiePathCopy("/newSubDirectory/");
String newPath New path to store GATC cookies under.
_createEventTracker(objName)var videoTracker = pageTracker._createEventTracker("Videos");
String objName The name of the tracked object.
_gat.GA_EventTracker_ A new event tracker instance.
_getAccount()String Account ID this tracker object is instantiated with.
_getClientInfo(1)_setClientInfo() for more information.Number 1 if enabled, 0 if disabled.
_getDetectFlash(1)_setDetectFlash() for more
information.Number 1 if enabled, 0 if disabled.
_getDetectTitle(1)Number 1 if enabled, 0 if disabled.
_getLocalGifPath()_setLocalGifPath() for more information.String Path to GIF file on the local server.
_getServiceMode()_setLocalGifPath()),
1 for remote mode (send data to Google Analytics backend server), or 2
for both local and remote mode.Number Server operation mode.
_getVersion()String GATC version number.
_initData()var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._initData();
pageTracker._trackPageview();
_link(targetUrl, useHash)_setDomainName() and _setAllowLinker()
methods to enable cross-domain user tracking. The _link() method passes the cookies
from this site to another via URL parameters (HTTP GET). It also changes the document.location and redirects
the user to the new URL.
<a href="http://www.newsite.com" onclick="pageTracker._link('http://www.newsite.com');return false;">Go to our sister site</a>
pageTracker._setAllowLinker(true);) in
order for link to work properly.
String targetUrl URL of target site to send cookie values to.
String useHash Set to true for passing tracking code variables by
using the # anchortag separator rather than the default ? query string
separator. (Currently this behavior is for internal Google properties only.)
_linkByPost(formObject, useHash)_setDomainName() and _setAllowLinker()
methods to enable cross-domain user tracking. The _linkByPost() method passes
the cookies from the referring form to another site in a string appended to the action value of
the form (HTTP POST). This method is typically used when tracking user behavior from one site to
a 3rd-party shopping cart site, but can also be used to send cookie data to other domains in pop-ups
or in iFrames.
<form action="http://www.shoppingcartsite.com/myService/formProcessor.php"
name="f" method="post" onsubmit="pageTracker._linkByPost(this)">
. . .
</form>
_setAllowLinker() must be set to true on the destination web page
in order for linking to work.
HTMLFormElement formObject Form object encapsulating the POST
request.
String useHash Set to true for passing tracking code variables by
using the # anchortag separator rather than the default ? query string
separator.
_setAllowAnchor(enable)http://mysite.net/index.html?source=In+House#method=email#offer_type=Fall+email+offers pageTracker._setAllowAnchor(true);
Boolean enable If this parameter is set to true, then campaign will
use anchors. Else, campaign will use search strings.
_setAllowHash(enable)example1.example.com and example2.example.com,
and you want to track user behavior across both of these sub-domains,
you would turn off domain hashing so that the cookie integrity check
will not reject a user cookie coming from one domain to another. Additionally,
you can turn this feature off to optimize per-page tracking performance.Boolean enable If this parameter is set to true, then domain hashing
is enabled. Else, domain hashing is disabled. True by default.
_setAllowLinker(enable)_link(),
_linkByPost(), and _setDomainName() methods
to enable cross-domain tracking.pageTracker._setAllowLinker(true);
Boolean enable If this parameter is set to true, then linker is
enabled. Else, linker is disabled.
_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(enable)Boolean enable True by default, which enables campaign
tracking. If set to false, campaign tracking is disabled.
_setClientInfo(enable)Boolean enable Defaults to true, and browser
tracking is enabled. If set to false, browser tracking is disabled.
_setCookiePath(newCookiePath)pageTracker._setCookiePath("/~username/");
pageTracker._setCookiePath("/myBlogDirectory/");
String newCookiePath New cookie path to set.
_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.
_setDetectFlash(enable)Boolean enable Default is true and Flash
detection is enabled. False disables Flash detection..
_setDetectTitle(enable)Boolean enable Defaults to true, and title
detection is enabled. If set to false, title detection is disabled.
_setDomainName(newDomainName)("auto" | "none" | [domain]). By default, the method is set to auto,
which attempts to resolve the domain name based on the location object
in the DOM. server1.example.com and server2.example.com, you would set the
domain name as follows:pageTracker._setDomainName(".example.com");_setAllowLinker()
and _linkpageTracker._setDomainName("none");
String newDomainName New default domain name to set.
_setLocalGifPath(newLocalGifPath)_setLocalServerMode() and
_setLocalRemoteServerMode() methods to determine
the path to the local server itself.String newLocalGifPath Path to GIF file on the local server.
_setLocalRemoteServerMode()_setLocalGifPath()._setLocalServerMode()_setLocalGifPath()._setRemoteServerMode()_setSampleRate(newRate)pageTracker._setSampleRate("80"); //sets sampling rate to 80 percent
String newRate New sample rate to set. Provide a numeric string as a whole percentage.
_setSessionTimeout(newTimeout)String newTimeout New session timeout to set in seconds.
_setVar(newVal)String newVal New user defined value to set.
_trackEvent(action, opt_label, opt_value)
String eventType The type name for the event.
String opt_label An optional descriptor for the event.
String opt_value An optional value to be aggregated with
the event.
Boolean whether the event was successfully sent.
_trackEvent(category, action, opt_label, opt_value)
String eventType The type name for the event.
String opt_label An optional descriptor for the event.
String opt_value An optional value to be aggregated with
the event.
Boolean whether the event was successfully sent.
_trackPageview(opt_pageURL)document.cookie.
It also updates or creates cookies as necessary, then writes them back to the
document object. Gathers all the appropriate metrics to send to the
UCFE (Urchin Collector Front-end).var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._initData();
pageTracker._trackPageview("/home/landingPage");
String opt_pageURL Optional parameter to indicate what page
URL to track metrics under. When using this option, use a beginning
slash (/) to indicate the page URL.
_trackTrans()_trackPageview(), and used in conjunction with the
_addItem() and addTrans() methods. It should be called after
items and transaction elements have been set up.var pageTracker = _gat._getTracker("UA-12345-1");
pageTracker._initData();
pageTracker._trackPageview();
pageTracker._addTrans(
"1234", // order ID - required
"Womens Apparel", // affiliation or store name
"11.99", // total - required
"1.29", // tax
"15.00", // shipping
"San Jose", // city
"California", // state or province
"USA" // country
);
pageTracker._addItem(
"1234", // order ID - required
"DD44", // SKU/code
"T-Shirt", // product name
"Olive Medium", // category or variation
"11.99", // unit price - required
"1" // quantity - required
);
pageTracker._trackTrans();
About Us | Request Info | Web Development | Search Engine Optimization | Graphic Design
All content and images are © 2010 The Found Corporation, Tucson AZ.
Tucson Web Design | Tucson Web Developer | Tucson Graphic Design | Tucson Custom Software | Tucson Web Software