Advanced: E-Commerce Roll Up Reporting For Websites With Different Languages

If you're a business owner of any size, you've at some point considered expanding. And as the web makes the world smaller, one way to expand is to offer your website in different languages and take your business across borders or to different segments. By entering other markets with your website, you can gauge new markets and find ways to grow and generate revenue.

Getting set up to offer your products and services in a different country can have a number of steps including localization and legal processes. Another thing to keep in mind is how you will set up your web analytics for the different languages and countries your site now serves.

We're highlighting a series of posts on the topic, called "Google Analytics reporting for multilingual e-commerce stores" by Gavin Doolan, a Googler based in Dublin specializing on Google Analytics for Europe. The posts are all from our Analytics blog in Europe, the Conversion Room. This is obviously a topic very close to the European businessperson's heart.

The great thing about the posts is that Gavin presents solutions for different structures of sites, since not everyone is doing the same thing when they sell products internationally or in different languages.



Custom variables webinar available for your viewing pleasure

Custom variables is one of the most powerful features in Google Analytics. With them you can segment traffic by almost any attribute. We recently hosted a webinar on how to make the most effective use of custom variables. If you missed it, you can now watch this highly informative webinar on the Google Analytics YouTube channel.



If you’re interested in learning how to use this powerful feature in Google Analytics, sit yourself down with some popcorn this Friday night and get analyzing.

Upcoming Webinar: Google Analytics Custom Variables

Custom variables are one of the most powerful features in Google Analytics. With them you can segment traffic by almost any attribute. For example, you could compare traffic from first-time customers versus repeat buyers. Or, if you run a content-oriented site, you could see which authors produce the most traffic..

While powerful, setting up custom variables can be a bit tricky, so we’re holding a webinar so you can learn how to make the most of them.

We'll start with Phil Mui, Senior Product Manager for Google Analytics, who'll share with you the features and capabilities of custom variables. Next, we'll hear from Nick Mihailovski, Google Analytics Developer Evangelist. Nick will show you how to implement custom variables on your website and share best practices.

We'll also be joined by Jim Snyder and Peter Howley from Empirical Path, a Google Analytics Authorized Consultant. They'll share how they implemented custom variables for the Business Insider and the insights they've gained as a result. We'll close with a Q&A session with all the speakers.

We’ve set up a Google Moderator to take your questions in advance and so you can vote on the questions you’d most like to see answered. Ask your questions

Date: Wednesday, March 24th
Time: 10:00 AM Pacific

If you can't make the live webinar, we'll post a recording on the Google Analytics YouTube Channel a week or two afterwards.

Advanced: Structure Your Account With Roll Up Reporting And More

Guest post by the team at E-Nor, a Google Analytics Authorized Consultant

For the analytics ninjas out there, you know that data accuracy is probably one of the most challenging aspects of analytics across all solutions and platforms, and you learn to apply best practices and establish processes to improve data collection and reporting.

But for the rest of us, how do we help marketers, business owners, and webmasters have confidence in their data? Analytics is all about clarity. It should help you see actionable statistics clearly and quickly. However, when you have a website structure with multiple domains and subdomains - which is often the case - sometimes things can get jumbled.

For instance, you are a CMO or a Director of Marketing at the enterprise and you are responsible for the performance and ROI of a large number of web proprieties. You look at your analytics reports and you can't find your ecommerce data from site A, site B is referring traffic to itself (definitely not a good thing!), and conversion data from your marketing campaign microsite is no where to be found.

This image sums up the feeling.

No need to panic. This post aims to offer an approach to help you plan your Google Analytics accounts setup in a structured fashion to help with clarity. I hope that by following the approach and the technical steps, you will be able to collect and manage all your data, make more sense of it, and most importantly, ensure what you are reporting on, trending, dashboarding and analyzing is based on accurate data.

There are two distinct sections of this post:

  • The Strategy (non-technical)
  • The How (technical)

The Strategy

There are many ways to structure your Google Analytics profiles when you have multiple domains and subdomains. But in this post I will limit myself to the one that I like the most and I believe is the least confusing.

Before I go into details of the solution, and for simplification, let us assume we are dealing with a pr
oject that has the following requirements:
  • A business with 3 domains (www.a.com, www.b.com, and www.c.com)

  • 1 domain (a.com) links to a 3rd party shopping cart (www.mystore.com)

  • 2 domains (a.com and b.com) have multiple sub-domains

Here is a graphical representation of the structure:

Measurement Requirements
  • Track each domain and sub-domain separately (e.g. www.a.com, news.a.com, and blog.b.com)

  • Track the rollup/overall traffic for all domains and sub-domains

  • Track full e-commerce transactions

Solution
  • Create a Google Analytics account for each domain (www.a.com, www.b.com, and www.c.com)

  • Customize the tracking code to link the multiple sub-domains with their main domains

  • Link the third party shopping cart with the main domain and install Google Analytics tracking code in all shopping pages

  • Create a rollup Google Analytics account and add its code to all domains and sub-domains
Graphical example of a well-planned Analytics Account Structure:

Now on to the technical stuff. If you don't enjoy javascript and regular expressions, you may stop here and ask your webmaster or technical analyst to read further :-)


The How:

I will try to illustrate the technical implementation in 10 simple steps:

1- Create a unique Google Analytics account for each domain www.a.com, www.b.com, and www.c.com and then use the account number UA-AAAAAAAA-1 in the code in step 3 and use the accounts UA-BBBBBBBB-1 for www.b.com and UA-CCCCCCCC-1 for www.c.com in the code in step 8.

2- Create a Google Analytics account for the a rollup account that will oversee all domains and sub-domains (use the GA account number UA-XXXXXXXX-1 in the code used in step 3 and 8)

3- Add the following Google Analytics tracking code to the main site (www.a.com) and its sub-domains (blog.a.com, news.a.com, images.a.com, and media.a.com)

About the following code: We have a regular pageTracker object to track activity on each particular subdomain and a rollupTracker to track activity across all subdomains and the third party checkout site. (Click here to learn more about the customizations we made to the standard Google Analytics tracking code)

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-AAAAAAAA-1");
pageTracker._setAllowHash(false);
pageTracker._setDomainName(".a.com");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
var rollupTracker = _gat._getTracker("UA-XXXXXXXX-1");
rollupTracker._setAllowHash(false);
rollupTracker._setDomainName(".a.com");
rollupTracker._setAllowLinker(true);
rollupTracker._trackPageview();
}
catch(err) {}

</script>

4- Enable E-Commerce Reporting

Analytics Settings > Profile Settings > Edit Profile Information

5- Add the following code* to all shopping cart pages on the store site (www.mystore.com)

*Make sure to add this code to the top of the pages.

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-AAAAAAAA-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
var rollupTracker = _gat._getTracker("UA-XXXXXXXX-1");
rollupTracker._setDomainName("none");
rollupTracker._setAllowLinker(true);
rollupTracker._trackPageview();
}
catch(err) {}

</script>

6- Add the e-commerce tracking code to the confirmation page after the GATC.

Read more about "How to track e-commerce transactions?"

7- Change the links to the store site (www.mystore.com) on the main site (www.a.com) to use _link as following:

If the current link looks like:

<a href="https://www.mystore.com">Buy Now</a>

Change it to:

<a href="https://www.mystore.com" onclick="pageTracker._link(this.href); return false;">Buy Now</a>

8- Repeat step number 3 for domains www.b.com and www.c.com after updating the Google Analytics account number UA-AAAAAAAA-1 and the setDomainName value.

  • To view the entire code for www.b.com and its sub-domains (click here)

  • To view the entire code for www.c.com (click here)

9- Create a profile for each sub-domain (only if needed)

In order to track a sub-domain (ex. blog.b.com) in its own profile, follow the following three steps:

a- Create a filter that include only traffic from Hostname=blog.b.com


b- Create a profile and name it "Blog"

c- Apply the sub-domain filter to the new profile

10-
As you might have noticed from the codes that we added so far to all pages, we added an extra Google Analytics account to track all pageviews across domains and sub-domains to one Google Analytics account. We call this account “rollup account”.

var rollupTracker = _gat._getTracker("UA-XXXXXXXX-1");
rollupTracker._trackPageview();

Since in the rollup account, we will track pages from different sites and many of these pages might share the same naming convention, I suggest that you create an advanced filter that adds the hostname to the page name to differentiate between pages with same URI.

Once you apply the filter, the upcoming data will appear as following:


Note, in the example above if we didn’t apply the “Add Hostnames” filter, all home.aspx pages will appear as one page with 2685 pageviews.

If you have been with us so far, you are now ready to conduct your analysis based on clean and much more accurate data :)
  • To review each domain by itself and for deep-dive analysis, use the domain profiles

  • To get an overview and to see how the business is doing across all sites, use the “Rollup Account”

Related Posts


Public Broadcasting Service (PBS) - Teach People to Fish


What works better, a centralized web analytics team with deep technical knowledge, or non-expert users spread throughout an organization? This was the question faced by Amy Sample when she joined PBS Interactive as web analytics director in the fall of 2007. Amy shared her story with us in response to our call to share your web analytics story.

Implementation


PBS Interactive helps individual PBS producers and local PBS stations create and promote microsites for programming like NOVA, American Masters, and Sid the Science Kid. Amy had the difficult task of helping these managers make educated decisions about how to improve their online show sites.

When Sample came on board, she learned that PBS had standardized on a single analytics tool. This was a good first step, but few at the company were familiar with the tool and the reports it generated were not being used to take action. Producers wanted to know more about how people interacted with microsites for their programs, but they weren't sure what to focus on. At the same time, the analytics group had a hard time keeping up with demands from so many stakeholders. According to Sample "The producers wanted to dig deeper into their site data than a monthly report could provide."

Amy's response was two-fold. First, after consulting with a pilot group of producers and other members of the interactive group, she decided to deploy an installation of Google Analytics. In Sample's words "We chose Google Analytics because we had to deal with a diverse group of needs and very limited resources. We wanted a system where a user with very little training could get insights right away."

Second, Sample worked with LunaMetrics, a Google Analytics Authorized Consultant, to manage the complex issues PBS faced with cross-domain tracking and a complicated account structure. LunaMetrics also created training materials, hosted an on-site training for PBS staff, and conducted a series of training webinars for producers and local stations.

Applying the Data

As it turns out, despite challenges around getting resources assigned to tag pages and working out the right account structure, deploying Analytics was actually the easy part. In Sample's experience, the more challenging problem came in spreading knowledge and awareness of Analytics through the organization in a way that lets people take action on the data. "My approach has been to teach people how to fish," Sample explains, "It's been about doing training classes and one-on-one work with key practitioners, creating specific training decks by job function and getting other groups to use Analytics data in their daily activities."

Google Analytics has been a key facilitator in the transformation of PBS online. Stakeholders are no longer focused on monthly reports. Increasingly, they are using Analytics to inform actual business decisions. Here are some examples highlighted by the PBS team:

  • Site Search Tracking - The PBSKIDS.org site has implemented changes as a result of insights gleaned from site search tracking that have increased traffic to the site 30% in the last year.


  • Funnel Optimization - The PBSKIDS Island team used funnels to optimize their registration path resulting in a 3x improvement in conversion rate.
  • Content Optimization - An analysis of users’ video consumption behavior on PBS.org and PBSKIDS.org led to the development of the PBS Video and PBSKIDS GO! Broadband portals. PBS went even further, basing a full 2008 PBS.org redesign on the data that indicated which content visitors access.
  • Advertising Optimization - PBS' marketing group also looks at post-click behavior for their display ad campaigns to zero-in on referring sites that send high-quality traffic. They use this information to optimize successive campaigns.
Long-Term Vision

Sample's long term vision is to extend Analytics to measure engagement with PBS content both on-site and off-site. She also hopes to gauge the impact of online content on TV tune-in and track online donations, while expanding her training efforts to teach producer colleagues how to segment traffic and drill deeper into visitor behavior on their microsites.

The lesson learned is that no matter what analytics tool you're using, a well-planned deployment is only a first step. The hard part is "teaching people to fish," and making analytics data a key component in your organization's everyday business decisions.

Segment your Traffic with the User Defined Report

Have you ever been in the Visitors section of your favorite Google Analytics profile and wondered what the heck “User-Defined” was? Well today it's time to find out.

So, what is “User-Defined?"

The user defined variable allows you to "label" a visitor if they complete a certain action on your site, such as making a purchase or visiting a key page. These labels are useful because they last across multiple visits to your site.

These labels are often called Custom Segments (or Custom Segmentation). You can see the data from these Custom Segments in the User Defined report, which is the last report of the Visitors section in Google Analytics.

How do I add these “labels” to my website visitors?

Making use of the User-Defined report in Google Analytics requires a bit of extra coding help from your IT department or webmaster, but it’s often well worth the effort.

For example, let’s say that I want to add a label of “customers” to any visitor who reaches my shopping cart’s receipt page. In order to do this, I would add an additional line of code to the Google Analytics Tracking Code (GATC) on my receipt page. It would then look something like this:

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-XXXXXXX-1"); pageTracker._trackPageview(); pageTracker._setVar(”customers”); } catch(err) {}</script>

Notice the line in bold that includes _setVar. When this is present on a page within the Google Analytics Tracking Code, an additional cookie (called the __utmv cookie) gets set on a visitor’s computer, with its sole purpose being to identify the visitor by the label (or value) that you used in the code. If you take a look at the code example above, you will see that I used the termcustomers,“ the label that I want to appear in the User Defined report.

Now, on their next visit to the site, they will be identified as a part of the “customers” segment in the User Defined report, allowing you to perform analysis on all visitors who have purchased something from your online store. Neat, huh?

Can I use _setVar when someone clicks on a link instead of visiting a page?

Yes - you can also use the pageTracker._setVar function when someone clicks on an important link on your site, or makes a key selection on an important form that you want visitors to fill out. For example, if you wanted to add a custom label to any visitor who clicks on your “Live Help” applet, you can ask your IT department or webmaster to add an “onClick” event, and give them the following line of code:

onClick="pageTracker._setVar('Needs Help');"

What will this look like in the end?

When all of your coding is complete, check the User Defined report after about a day or so and you should see something like this:

After the data has been collected by Google Analytics, you can interact with it just like you would with any other report. Click on the “Goal Conversion” tab directly above the table to see how many customers have reached key pages of your site, or use the dimensioning feature to see what sources of traffic were responsible for bringing these special visitors to your website!

Are there any other ways to use _setVar?

One neat usage of the _setVar function is to use it to exclude your own traffic from reports when using a dynamic IP address. For example, let’s say that you wanted to exclude your entire company’s traffic from appearing in reports, and your company uses dynamic IP addresses.

Because it would be nearly impossible to write a filter to exclude traffic from a dynamic IP address, you can create an HTML page that is not a part of your website and add Google Analytics Tracking Code with the call to _setVar and a label of “employees” (or something similar).

Next, you can ask each employee to visit that page from their browser of choice – this will drop a cookie on their computer, identifying them as “employees.” Finally, you can then apply a filter with the following specifications to your profile, and your internal traffic will be excluded:

  • Filter Type: Custom Filter >> Exclude
  • Filter Field: User Defined
  • Filter Pattern: employees
  • Case Sensitive: No

Some technical notes about Custom Segmentation:

  1. As we just talked about, when a person visits a page calling the _setVar function, the __utmv cookie is set on their computer. This is a persistent, first-party cookie that has a lifetime of two years. This means that every time a user with a __utmv cookie returns to your site, the label assigned to the user will continue to identify them as such until they either delete the cookie or visit another page with another call to _setVar with a different label.

  2. The purpose behind something like a User-Defined report - and Custom Segmentation in general - is that it is not designed to be updated very often. This label, for the most part, should be a permanent one for a visitor. You should only use _setVar on pages like a receipt page of a shopping cart, or an account registration “success” page for a visitor who becomes a member of your site. You shouldn’t use _setVar on your homepage, or use several different _setVar’s with different labels scattered across many pages of your website.

  3. Google Analytics - at this time - only has the capacity to store one custom segment at any one time for one website. So if you are using multiple calls to _setVar on your site, Google Analytics can only store the latest value that a visitor runs into in the __utmv cookie. John Henson at LunaMetrics – a fellow Google Analytics Authorized Consultant - has created a custom version of the Google Analytics Tracking Code that can support multiple custom segment labels at any one time.

  4. On the other hand, Google Analytics uses what they call the “first association” of the session for visitor session calculations. If you are using multiple calls to _setVar on your site, be aware that if a user runs into the first one, and then runs into the second one in the same visit, their Goal Conversion and Pages per Visit metrics would be attributed to the label of the first encounter with _setVar.

  5. For page view calculations, Google Analytics uses the most recently defined value. So if a person runs into the second instance of _setVar on your site, all of their pageviews afterwards - including the current pageview - will be attributed to the second _setVar’s label, even though as we just learned in #4 above, visitor session information is attributed to the first encounter of _setVar.

A full, technical explanation of _setVar and the User-Defined Report can be found here.

Summary

The User Defined report in Google Analytics is a great place to start segmenting your traffic. With a little bit of help from your IT department, you can not only begin to collect awesome data, but you can also begin to gain advanced knowledge about what makes your VIP website visitors register, sign-up for your newsletter, or purchase something from your online store. This will definitely help you become that Analysis Ninja that Avinash Kaushik loves to talk about!

Written by Joe Teixeira of MoreVisibility, a Google Analytics Authorized Consultant.