Analytics Market Chart

How Google Analytics Gets Information

When Google Analytics code gathers information about each pageview, how does it send that information to the data collection servers so it can be processed?

The information is sent in the query string of a request for the __utm.gif file. This file is requested for every single pageview, transaction and event. When the files are processed, Google Analytics can then string together the individual actions into a visit.

Many organizations store a copy of every tracking request sent to Google Analytics data collection servers - this is accomplished with the setLocalRemoteServerMode(); function in ga.js. Once you have a local copy of Google Analytics tracking requests, you can process them with Angelfish Software.

(This article looks at __utm.gif from the Traditional code (ga.js), but you can also keep a local copy of Universal Analytics tracking data (analytics.js) - instructions are available via the above link to Angelfish Software)

Dissecting __utm.gif

A typical __utm.gif request is long and messy. Here is an example:

http://www.google-analytics.com/__utm.gif?utmwv=4&utmn=769876874&utmhn=example.com&utmcs=ISO-8859-1&utmsr=1280x1024&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=9.0%20%20r115&utmcn=1&utmdt=GATC012%20setting%20variables&utmhid=2059107202&utmr=0&utmp=/auto/GATC012.html?utm_source=www.gatc012.org&utm_campaign=campaign+gatc012&utm_term=keywords+gatc012&utm_content=content+gatc012&utm_medium=medium+gatc012&utmac=UA-30138-1&utmcc=__utma%3D97315849.1774621898.1207701397.1207701397.1207701397.1%3B...

Although the URL looks overwhelming, it's pretty simple when broken down. First, there is the request for www.google-analytics.com/__utm.gif. This is the foundation of the Google Analytics reports. (If you are using Urchin, the __utm.gif will be requested from your own domain.)

There is a long query string with a dozen or so URL-encoded parameters, depending on when this is requested. Each parameter stores a specific piece of information that is used to populate the reports. Some parameters are only used in specific cases. Others must be there every time.

What Information Does Google Analytics Store?

The table below is directly from Google. It lists every piece of information that Google Analytics gathers for any given interaction with the website. We modified some descriptions.

Pageview Parameters

These parameters are included in the __utm.gif whenever a pageview is being reported.

Variable Description Example Value
utmac* Profile number.
*Does not appear on Urchin hits.
utmac=UA-2202604-2
utmcc* Cookie values. This request parameter sends all the cookies requested from the page.
*In Urchin, this parameter is not used because the cookies are stored in the log files.
utmcc=__utma%3D117243.1695285.22%3B%2B __utmz%3D117945243.1202416366.21.10. utmcsr%3Db%7C utmccn%3D(referral)%7C utmcmd%3Dreferral%7C utmcct%3D%252Fissue%3B%2B
utmcn Starts a new campaign session. Either utmcn or utmcr is present on any given request. Changes the campaign tracking data; but does not start a new session. utmcn=1
utmcr Indicates a repeat campaign visit. This is set when any subsequent clicks occur on the same link. Either utmcn or utmcr is present on any given request. utmcr=1
utmcs Language encoding for the browser. Some browsers don't set this, in which case it is set to "-" utmcs=ISO-8859-1
utmdt Page title, which is a URL-encoded string. utmdt=analytics%20page%20test
utmfl Flash Version utmfl=9.0%20r48
utmhn Host Name, which is a URL-encoded string. utmhn=x343.gmodules.com
utmje Indicates if browser is Java-enabled. 1 is true. utmje=1
utmn Unique ID generated for each GIF request to prevent caching of the GIF image. utmn=1142651215
utmp Page request of the current page. utmp=/testDirectory/myPage.html
utmr Referral, complete URL. utmr=http://www.example.com/aboutUs/index.php?var=selected
utmsc Screen color depth utmsc=24-bit
utmsr Screen resolution utmsr=2400x1920
utmul Browser language. utmul=pt-br
utmwv Tracking code version utmwv=1
E-commerce Parameters

These parameters are only included in the __utm.gif when a transaction is being reported. One __utm.gif is requested for the transaction, and one additional __utm.gif is requested for each item in the transaction.

Variable Description Example Value
utmt A special type variable applied to events, transactions, items and user-defined variables. utmt=Dog%20Owner
utmipc Item variable: Product Code. This is the sku or product number. utmipc=989898ajssi
utmipn Item variable: Product Name, which is a URL-encoded string. utmipn=tee%20shirt
utmipr Item variable: Unit Price. Set at the item level. utmipr=17100.32
utmiqt Item variable: Quantity utmiqt=4
utmiva Item variable: Variations on an item or category. For example: large, medium, small, pink, white, black, green. String is URL-encoded. utmiva=red;
utmtci Transaction variable: Billing City utmtci=San%20Diego
utmtco
Transaction variable: Billing Country utmtco=United%20Kingdom
utmtid Transaction variable: Order ID, URL-encoded string. utmtid=a2343898
utmtrg Transaction variable: Billing region, URL-encoded string. utmtrg=New%20Brunswick
utmtsp Transaction variable: Shipping cost. utmtsp=23.95
utmtst Transaction variable: Affiliation. Typically used for brick and mortar applications in ecommerce. utmtst=google%20mtv%20store
utmtto Transaction variable: Grand total. utmtto=334.56
utmttx Transaction variable: Tax. Values as for unit and price. utmttx=29.16
Special Parameters

These parameters are only used in special circumstances, like event tracking.

Variable Description Example Value
utme Event Tracking Data Parameter Value is encoded.
utmt A special type variable applied to events, transactions, items and user-defined variables. utmt=Dog%20Owner