I found something interesting on the Google Code site today. In one part of it they had “How GIF Requests Are Classified”. Interesting, since that’s what this section of this series has been all about. In it they cite the following:

A GIF request is sent to the Analytics servers in the following cases and classified according to the table below. In each of these cases, the GIF request is identified by type in the utmt parameter. In addition, the type of the request also determines which data is sent to the Analytics servers. For example, transaction and item data is only sent to the Analytics servers when a purchase is made. Visitor, page, and system information is only sent when an event is recorded or when a page loads, and the user-defined value is only sent when the _setVar method is called.

They then go on to mark pages, events, transactions, and items as “interactions” and var’s as non-interactions, claiming:

Requests classified as interaction requests will impact the bounce rate calculations for your page or site. Bounce rate is referred to as a single-page visit to your site, but is strictly defined as a single interaction request during a user session. For this reason, a bounce rate for a page is also affected by ecommerce transactions and event tracking requests. This is because these features co-exist with page tracking and, when they are triggered, they result in additional interaction requests to the Analytics servers.

Man, that could have saved me a few posts, eh?

Anyhow, today we’re going to talk about the last two in that list: trans and items. These are added using _addTrans() and _addItem() functions.

_addTrans() initializes a transaction object, which stores all your transaction data (billing address, shipping charges, etc.). These are then associated with items via an order ID. Makes sense right? You can have multiple items within one transaction. Think of this as your shopping cart.

_addItem(), on the other hand, tracks information specific to each item in a shopping cart. This can be SKUs, price, quantity, etc.

Specifically, trans tracks:

  1. order ID – required
  2. affiliation or store name
  3. total – required
  4. tax
  5. shipping
  6. city
  7. state or province
  8. country

While item track:

  1. order ID – required
  2. SKU/code – required
  3. product name
  4. category or variation
  5. unit price – required
  6. quantity – required

I used an ordered list here for a reason. Each property must be listed in the correct order. If you don’t use that property then you will have to list it differently. eg. _addItem(“12345”, “46789”, “”, “”, “24.99”, “1”);

Remember, according to Google:

If a transaction contains multiple items and the SKU is not supplied for every item, a GIF request is sent only for the last item added to the transaction for which a SKU is provided. In addition, if your inventory has different items with the same SKU, and a visitor purchases both of them, you will receive data for only the most recently added. For this reason, you should make sure that each item you offer has a unique SKU.

So, what should your _addTrans and _addItem’s look like:

'1234',           // order ID - required
'Acme Clothing',  // affiliation or store name
'11.99',          // total - required
'1.29',           // tax
'5',              // shipping
'San Jose',       // city
'California',     // state or province
'USA'             // country
// add item might be called for every item in the shopping cart
// where your ecommerce engine loops through each item in the cart and
// prints out _addItem for each
'1234',           // order ID - required
'DD44',           // SKU/code - required
'T-Shirt',        // product name
'Green Medium',   // category or variation
'11.99',          // unit price - required
'1'               // quantity - required
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers

Remember that you’ll need a tracktrans to submit the transaction data to the analytics servers.

Associated with an ecommerce transaction is going to be the following values:

  • utmtid – your OrderID
  • utmtst – affiliation
  • utmtto – total value for a unit
  • utmttx – total tx
  • utmtsp – shipping cost
  • utmtci – billing city
  • utmtrg – billing reigon
  • utmtco – billing country

So, you set your _addTrans and _addItem, your visitor visits, visits the right pages, and those make calls through _addTrans and _addItem to Google Analytics, which then writes them into a .gif request and…

…your utm.gif should look something like the following:

Per Transaction:


Per Item:


And there you have it. We’re done with request types! Stay tuned next week when we take a look at more juicy details of utm.gif requests and how to Really Understand Google Analytics.

  • What are UTMS and UTMU ?

  • Dave Davis

    So do TWO different utm.gif requests need to be made? Or can the transaction and item be sent as one single request? Could you show me an example of what an entire utm.gif request containing a typical ecommerce transaction would look like?