5 Google Analytics posts you don’t want to miss in September

Here’s again the last post of the month saved for the top 5 interesting Google Analytics related resources I found on other sites.

So much good stuff this month! It’s hard to pick up only 5 blogs to share. Here’s the selection for September – you may want to bookmark those as they can be very useful:

Magically track forms using Google Analytics

In this post Benjamin shows how to use Komito Analytics to track form abandonment and interactions fast and easy. It’s JavaScript that you can add in Google Tag Manager and automatically track a number of custom interactions.

Tracking Multiple Categories in Google Analytics for Content Pages

A step-by-step tutorial how to track articles that are associated with multiple tags and categories in Google Analytics. You’ll create a custom dimension for each page category and a custom metric to track how often each category is viewed.

Get the Recipe: Hover Tracking in Google Tag Manager

Google Tag Manager doesn’t automatically listen for hover events and the awesome guys at LunaMetrics provided a recipe that you can download and import into your GTM container. Follow the extra instructions and start tracking hover events!

10 JavaScript Concepts For Web Analytics Implementation

This blog from Simo follows a conference talk he gave at MeasureCamp IX, London earlier this month. I agree that understanding the JavaScript basics are extremely important in web analytics implementation. Go through the 10 JS concepts presented and if you’re still feeling lost, go ot Codecademy, get a book about JS and practice!

Google updates – there were so many amazing announcements from the GA team: you can move GA properties (extremely useful for agencies that have all their customers GA sites under one account), work with the improved unique events metric and sign up for the free Google Optimize!

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.

Check Geo Location for Specific Pages in Google Analytics

Here’s a recent question I got:

“We have a website domain.com, but there’s a specific set of pages at domain.com/demo that are used for a presentation tool for potential customers. We need to see for the visitors who view these special pages, which US states they are coming from.”

Let’s build an advanced segment to achieve this.

Open Google Analytics and click on + Add Segment at the top and the red + New Segment. Give your segment a name, like Demo pages, choose Conditions from the left pane and filter for Sessions – Include – Page – Contains – /demo/

demo pages segment

Then go to Geo -> Location report with your new segment applied. Click on United States and you’ll get the list of states (called Region in GA):

states segment applied

 

You can go to any other standard or custom report with the same segment applied to check what’s special about these potential customers.

This is just a simple example of how powerful the advanced segments can be.

Track onclick event handler value with Google Tag Manager

It’s not very common but you may stumble upon a case where you need to record the value of an onclick event handler.

Usually you have a JavaScript function and the “onClick” event handler executes a piece of JS when an element is clicked on. It can be added to elements like <a> tags, form buttons, check boxes, <div> tags, etc. Here’s an actual example:

&lt;script&gt;
function inform(){
alert("You have activated me by clicking the grey button! Note that the event handler is added within the event that it handles, in this case, the form button event tag")
}
&lt;/script&gt;

&lt;form&gt;
&lt;input id="click-me-button" type="button" name="test" value="Click me" onclick="inform()"&gt;
&lt;/form&gt;

On this test page we have a button that will show an alert when clicked. And we want to record an event with some category that we define and the onclick value as action (it will dynamically change if you have different onclick event handlers).

Let’s build our variable first:

function() {
var field = {{Click Element}}.getAttribute('onclick');
return field;
}

It will get the onclick value of the element you’re clicking.

onclick variable

Now let’s enter Preview & Debug mode and see if it does what we need – click on the button and explore the variables list:

onclick GTM preview

Looks good! Now we can build a simple event tag in GTM, firing on the click of this button:

tag settings

Publish the workspace and start gathering data:

real time results

So, that’s it! What kind of onclick event handlers do you need to track?

5 Google Analytics posts you don’t want to miss in August

Here’s again the last post of the month saved for the top 5 interesting Google Analytics related resources I found on other sites. Here are the five for August – you may want to bookmark those as they can be very useful:

Introducing the Google Analytics Demo Account

In the beginning of the month Google Analytics launched a fully functional Demo Account, available to everyone, with real ecommerce data from the Google Merchandise Store. Avinash published a great post about it, explaining how to get access and jump-start your learning: Be Real-World Smart: A Beginner’s Advanced Google Analytics Guide

Two Steps To Correctly Tracking Subdomains in Google Analytics

This LunaMetrics article shows how to properly implement subdomain tracking in Google Tag Manager, along with example scenarios. Check out the reasons why you need (or don’t) subdomain tracking and what to do next.

Troubleshooting Cross-Domain Tracking In Google Analytics

In this post Simo shows the easiest way to implement cross-domain tracking – through Google Tag Manager. You can use his short checklist to identify issues and make sure cross-domain tracking is working.

GTM Match Table Variable Generator (Lookup Tables & Beyond)

Despite being an extremely useful feature in Google Tag Manager, the lookup table Variable can be tedious to configure and it supports exact-match only. You can use this template by Seer Interactive to easily create a big lookup table or get regex support.

Enterprise-Class Tag Management: Announcing Workspaces

Google announced a major update to Google Tag Manager introducing workspaces and interface changes. Simo Ahava published two quite comprehensive articles on the same day which can be used as walk-throughs for the new features:

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.

Sogou Explorer and Baidu Browser are hidden in Google Analytics

If your website serves the Chinese market you’d want it to work well and render properly for your customers. I was checking the browser stats for a Chinese website and my colleagues were surprised to see that two of the popular Chinese browsers are missing from the list: Sogou Explorer and Baidu browser.

So I installed them to check what’s exactly going on for these two. Let’s start with Sogou Explorer by opening the developer tools console on the Network tab (you can check Preserve log box) and loading our website with custom campaign parameters like ganotes.com/?utm_source=test&utm_medium=test&utm_campaign=test. Search for ‘collect’ which is a part of the GA hit and look at the headers:

Sogou user agent

The user-agent shows a long string: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.22 Safari/537.36 SE 2.X MetaSr 1.0

When we go to Google Analytics to check how the traffic from this specific source / medium is recorded we see:

Sogou in GA

and the browser version is:

Sogou version in GA

So, in my case my session from Sogou Explorer is recorded as a session from Chrome 49.0.2623.22, that’s why there’s nothing mentioning Sogou in Google Analytics Browser report. Depending on its internal logic, sometimes it will show up as Chrome and sometimes as Internet Explorer.

Now, let’s do the same for Baidu Browser.

Baidu user agent

The user-agent shows a similar string: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36

When we go to Google Analytics to check how the traffic from this specific source / medium is recorded we see:

Baidu in GA

and the browser version is:

Baidu version in GA

Similar to Sogou Explorer, Baidu browser is recorded in GA as Chrome 43.0.2357.124, and there’s no way to distinguish between real Chrome sessions and these ‘fake’ ones.