Shopify Google Analytics Integration

The following is the tale of some investigative work I did for a company which approached me to help them with their Google Analytics tracking for their online store. This company, like so many others, sells items on the Internet and wants to be able to properly attribute their sales to the correct channel using Google Analytics. Not surprisingly, in addition to having subdomains they were using a third party shopping cart and needed to have cross domain tracking configured.  Pretty simple.  Or so I thought…

  Shopify Homepage

As it turns out, the third party shopping cart they were using is called Shopify.  As far as being an intuitive user interface that makes it easy for non-technical users to set up their store, I certainly see a lot of positives with Shopify.  Unfortunately, Shopify also tried to make setting up Google Analytics “dumb proof.”  In the end, trying to figure out why I couldn’t properly set up a simple, working basic GA tag led me to be “dumbfounded.”   Shopify has a very simple interface where one simply needs to copy and paste their Google Analytics tracking code in order to get started.  

shopify pasted GA code  

However, as soon as you save the file, Shopify takes the Google Analytics code and rewrites it to match their own settings. In particular, they are choosing to _setDomainName to “none”, adding _setAllowLinker (which would indeed be  required for cross domain tracking) and switched to dc.js.  (I am not sure if the folks at Shopify paid attention or not, but to use the DoubleClick cookie, users are supposed to Continue reading Shopify Google Analytics Integration

Google Analytics Updates How Visits are Calculated

Google Analytics Updates How Visits Are Calculated

In a recent blog post, the Google Analytics team made announced that they are changing the way that visits (sessions) are calculated. Interestingly, they said that, “Based on our research, most users will see less than a 1% change.” Unfortunately (imho), they didn’t cover their bases with that statement as the comment section of the above cited blog post shows that lots of people are going pretty crazy about these changes.

**Update** On August 16th, the Google Analytics Team announced that there was a bug in the way visits were recorded after they launched the change. Now, people should be going less crazy as numbers are making a bit more sense. Nevertheless….

Bottom line, this is really a significant change and it seems that people aren’t understanding what is going on. The main things that people seem to be complaining about are:
  • Increase in visits
  • Increase in bounce rate
  • Decreased average time on site
  • Decreased pages per visit

Surprisingly (maybe), I didn’t see a lot of people complaining about a decrease in conversion rate. Hmm… In any case, one comment that I saw rise above the negative spew in the GA blog comment section was by Peter at L3 Analytics. He linked to his blog post which does a nice job discussing some of the implications of the change to the way sessions are calculated. I decided to add to the discussion with this post. Some of what I’ll be saying has already been formulated by Peter. Other things will hopefullly be new , including a number questions I have based on some data in GA that I am still not understanding based upon my current knowledge of the change.

**Side Note** It upsets that people can get so negative in their comments made in forums and blog posts, especially since most of their complaints stem from a lack of understanding. Simple questions in the comment section such as “I don’t understand why 123xyz is happening….” would be nicer to address than “this data is useless, (sarcastic) thanks alot!!”

Understanding the change.

Google Analytics receives hit level data and then calculates all metrics based upon that hit level data. Every time there is a pageview, event, or transaction, a gif request is sent to the Google Analytics servers with information about that hit. Part of that gif request includes session information, and other parts of that gif request include visitor level information. I’m not going to go into the UTM gif requests in depth here, but if you really want to know what is going on check out the RUGA (Really Understanding Google Analytics) series of posts from Cardinal Path. (Kent – it would be great if you could add inner linking between posts on the blog, it’s a great series).

Here is a graphic I quickly put together. (As you can tell, I’m not much of a graphic designer).

The idea that this is trying to illustrate is a visit (session) is made up of hits. A visitor can visit the site multiple times. When a “visitor” has two or more visits, they change from being counted as a “New Visit” to a “Returning Visitor.”

**Side note: We use the term “visitor,” but technically this means “__utma Cookie.” Cookies are browser specific. So if I, Yehoshua Coren, visit in a 5 minute span from 3 different browsers, GA reports that 3 “unique visitors” came to the site. Similarly, if 3 different people in my household visit at different times throughout the day, this is 1 “unique visitor.” Lastly, if I visit a website repeatedly using Private Browsing (Firefox) or Incognito Mode (Chrome), etc, my cookies are cleared on browser close so I’ll be an additional “unique visitor” (with a ‘new visit’) on every subsequent visit.

So how does Google Analytics calculate visitors and visits?

Continue reading Google Analytics Updates How Visits are Calculated

Multi-Touch Attribution with Google Analytics.

Multi-Touch Attribution with Google Analytics

It is well known that Google Analytics relies on last touch campaign attribution.  In short, this means that conversions and transactions are attributed to the most current traffic source of the visit (i.e. the ‘last touch’).  It goes without saying, but you should read  Avinash Kaushik’s Web Analytics 2.0 (attribution models are discussed chapter 12) if you haven’t done so already.  It’s a great intro to the issue at hand.  Additionally, there has been lots written about this already, with a number of different solutions given for how to overcome the limitation in Google Analytics.  After many hours of scouring the web, I must admit that I didn’t find a solution that adequately met my needs for Google Analytics.

To be fair, I just came across which uses it’s OWN cookie to pass data into GA using event tracking (use a 2nd tracker so you don’t skew your bounce rate).  I’m interested in trying it out.  I especially like how YourAmigo has a number of out of the box reports that automate a number of attribution models.  Very cool.

Also, what we’re about to see here isn’t really an attribution model. The *value* assigned to the first touch, middle touches, and last touch aren’t addressed here. What this post does address is the lack of visitor level data in GA. Using the method below, you’ll be able to IDENTIFY all of the touches that bring visitors back to you site. So while branded keywords may indeed be the best converters on your site, wouldn’t it be nice to know how many of those visitors first visited your site after clicking on a PPC ad?

In any case, here’s how I push VISITOR level data back into GA (which of course can and should then be sliced and diced via advanced segments and custom reports – yummm!!!).

The UTMA Cookie.

Google provides an excellent introduction to the cookies that GA uses here.  If you are new to the cookies, definitely watch the presentation.  Here is a screen cap of the __utma cookie info. ( © 2008 Google)
Google Analytics UTMA Cookie The UTMA cookie is central to a TON of the reporting in Google Analytics.  Visitor Loyalty, Visitor Recency, Days to Purchases, Visits to purchase, etc etc… all of these metrics rely on this visitor level cookie.  As can be seen in the image above, every visitor who comes to your site is assigned with a random unique ID. Continue reading Multi-Touch Attribution with Google Analytics.