Google Universal Analytics For Offline Behavior

Google Universal Analytics

I have been a very assiduous visitor to the Weizmann Institute of Science in the last four years as my wife studied her PhD. Besides going through the Institute during week days on my way to work, I also visit the various green areas and playgrounds with my kids during the weekends.

One of the rules that always impressed me in the Institute is that you can't go in or out without either passing an ID card in a turnstile or driving a registered car. This is a very strict policy, which is similar to a website that requires a login for opening it.

During all my visits to the Institute I never really thought about it using my Web Analyst hat, but this changed last week. While passing my ID card to visit the Institute, it suddenly came to my mind a demo of Universal Analytics by Nick Mihailovski, Senior Developer Programs Engineer in the Google Analytics team, where he showed how it can be used to collect offline data for things like swiping an ID card.

So I thought: "the Weizmann Institute could do some pretty interesting analyses if they used Google Analytics to track offline behavior..." This article shows how I would approach such an implementation. I focus more on the Google Analytics account design, rather than the codes necessary to make it happen; I will provide links to relevant code explanations whenever necessary.

But before that, let's go over a quick overview of what exactly is Universal Analytics and why is it different from the Google Analytics everyone is acquainted with.

What Is Universal Analytics?

Universal Analytics (UA) is the new generation when it comes to measurement. It is a new way of collecting data with Google Analytics that enables a myriad of capabilities using this platform. Here are some of the highlights:

  • User level data: probably the most significant change from the standard Google Analytics to Universal is that it will no longer aggregate data on a visit level, but on a visitor level. While it is still forbidden to send Personal Identifiable Information to Google Analytics servers, this will enable tracking user level behavior using a unique identifier.
  • Multi environment tracking: with the Measurement Protocol, Google introduced a multitude of additional collection capabilities, allowing its users to collect and send incoming data from any digital device to Google Analytics. This means that we can track more than just websites now, which will be the focus of this article.
  • Custom dimensions & custom metrics: custom dimensions and custom metrics are default dimensions and metrics that can be created to your own specific needs and using information you collect on the website (e.g. information provided by visitors on a registration form).
  • Simplified configuration: Universal Analytics provides more capabilities to change your data collection from within the admin interface, changes that were previously accessible only through the development environment.

There is more to Universal Analytics than the highlights above, you can find a great overview of them in Justin Cutroni's post, he provides some interesting explanations and examples. And if you are wondering how to go about migrating your current Google Analytics account from the standard code (ga.js) to Universal (analytics.js), here is another useful resource by Justin. Hint: you should do that using the excellent Google Tag Manager.

Another useful resource to learn about Universal Analytics on a more strategic level is Feras Alhlou's article, where he discusses the extremely valuable new approach of user-centric analytics; this approach can tell us a lot about our visitors. But, it can go beyond that to tell us more in-depth information about their visits and their habits. It essentially gives us an overview of their behavior, which in turn, provides us with a better understanding of our customers.

Google Analytics Account Design - Translating Offline Actions

So, let's go back to our example, monitoring the traffic/behavior of people going in and out of a closed establishment. The emphasis on "closed" is important, as it enables a much more accurate tracking; the model proposed below would not be possible on a place where people can go in and out unidentified, like a regular store (you will understand why later).

When you set sail for a Google Analytics implementation to track offline behavior, you will be boarding an adventurous ship!

Defining the implementation objective

The first step, as always, should be to define the objective of such an implementation. Here are the three main insights I would like to learn if I worked at the Weizmann Institute:

  1. Flow Visualization: which of the 10+ gates people use the most, and do they come in by car or walking? Do they leave through the same gate or through another gate? This information can be used to plan opening hours of specific gates and whether some gates should be shut down or created.
  2. Rush Hours: which days of the week and time of the day the Institute has the highest number of people inside? This information can be used to plan maintenance works and events.
  3. Facilities usage: there are different people coming in (e.g. students, subscribers to the pool, walkers), when each "segment" visit the Institute? This information can be used to understand the flow of different people through the campus and make changes to streets or pavements.

Visitors, Visits, Devices, Pages, Custom Dimensions

With the goals in mind we can start to define which Google Analytics fields we will use to collect the necessary data. After some thinking, here is how I would like to collect the data:

  • Visitor: when a person gets an ID card (which must always be the first action), he or she will become a new visitor, and will be counted as a unique visitor in future visits to the Institute.
  • Visit: every time a visitor enters the Institute they start a new visit, which will last until the person leaves it.
  • Device: since we don't have a browser, we consider a device to be the transportation mode, i.e. a car, a motorcycle or legs.
  • Custom Dimensions: in order to segment the visitors and learn more about their behavior, we will create a series of custom dimensions (visitor level) for each visitor:
    • ID: ID number
    • Type: Masters_Student, PhD_Student, Professor, Employee, Spouse...
    • Department: Physics, Biology, Chemistry...
    • Building: the name of the building.
  • Pages: every time a person passes his/her ID card either in a turnstile or drives a car into the Institute we will send a page with the gate name, something in the lines of '/walk/main-gate/'. At nights and weekends, a card is also necessary to enter a building, so we will also send a pageview to gather more accurate flow navigation information. Note: I decided to include the transportation mode in the page name as it is an intrinsic characteristic of the gate.
  • Events: we should use events for less "important" actions, things like swiping the card in a photocopier or other in-building activity.

This is basically what I would send to Google Analytics. The resulting information wouldn't be as rich as in a website, but it would be actionable and organized.

The important is to collect the data you need to help you make decisions, not to collect as much data as possible.

Implementing Google Analytics Offline With The Measurement Protocol

But how do you go about implementing such a thing? That's not simple, and it will require quite a bit of development. If you work for the Weizmann Institute, the specifications are half done, but if not (which I guess is probably true), you have to first define the objectives and try to map your offline actions into Google Analytics fields (as I did above).

Then, check the Measurement Protocol Developer Guide, it provides and overview and some examples on how to send hits to Google Analytics using the Measurement Protocol.

Then, visit the Measurement Protocol Reference, which describes to where and how to send data to Google Analytics; it also describes the required values when you send data and the supported data types.

Closing Thoughts

In summary, Universal Analytics opens up so many new possibilities! As you can see above, it can be used to anything we can imagine.

But the example above is an exception, very few establishments require identification, and usually you would like to track online and offline behavior. Things like:

  • How successful was an incentive to visit a brick-and-mortar store on the website?
  • How did people that ended up buying a product offline using a coupon got to my website?
  • How many of my AdWords leads ended up closing a deal on a call center?

The list could go on and on, so I hope you enjoy the Analytics journey, it will never end!

Subscribe To Our Newsletter For Monthly Updates

Your e-mail will be kept private

Gemma Holloway | March 2013

I really enjoyed this post Daniel - Was very impressed of how in depth you had mapped out the process for the institute.

I have frequently heard mutterings of Google integrating online and offline consumer behaviour but this post really brings alive how they will make this process reality.

Universal analytics is definitely set to be the future!

Daniel Waisberg | March 2013

Thank you for the kind words Gemma. One thing: Universal Analytics is not the future, it is the present! ;-)

Gemma Holloway | March 2013

Good point! :)

Damion | March 2013

Fantastic stuff dude. Felt like reading science fiction, and I had to remind myself that nope, this is the present reality!

One question: why choose pageview for a turnstile interaction, and not an event? Wouldn't there be just as much detail that could be captured in an event, without needing to fire a pageview?

Daniel Waisberg | March 2013

Yes, I stopped reading science fiction, I prefer the Google Analytics documentation :-)

As for the pageview, I chose it because I thought it would be interesting to see the navigation flow, which is more straightforward with pages. I can go to any specific page and check what was the last page this visitor saw and what was the next using the Navigation Summary tab. That's the main reason.

Ramki@DigitalMarketingAnalytics | March 2013

What kind of specific report can we generate using universal analytics. At the point, Universal analytics has these pain point.

It is not possible to migrate existing ga.js snippet to UA snippet.
remarketing, double click will not be syndicated in UA

Daniel Waisberg | March 2013

At this point there are no specific reports for Universal Analytics. The only difference in the interface will be found in the Admin section, where you can configure additional settings which were previous available only through code change.

As for the pain points, I am sure the Google Analytics team is working hard on them, stay tuned!

Andy Harris | March 2013

What's really interesting here is that there's opportunity for all to capitalise on Universal Analytics (before the big players do). An example from the UK is that people are saying the high street is dying (competition from online) - if town centre management people found a way to use Universal Analytics (e.g. some sort of bonus if people 'swipe in' to the shops they go to) then they'd build up a better picture of how people really use the high street, which could help in some way.

In short, there's not shortage of smaller businesses complaining about the economy etc. but something like Universal Analytics could perhaps be an opportunity to capitalise on in some way.

Harshil Adesara | April 2013

This is the best post I have read so far on Universal Analytics! (and I've read plenty of them!)
My company has been trying to figure out how we can track customers better. Will start implementing custom metrics and dimensions pretty soon. Will share the results with you once I 'figure things out'!

John Walker | July 2013

That is actually a great overview, really enjoyed reading it. But when it comes to practicality, aka actual usage of Universal Analytics on daily basis. How useful was it personally for you?

Francisco | October 2013

I think that universal analytics would be awesomer "if" it could factor in returns like Adobe Analytics. Going into the CRM and counting offline sales that were done via phone would be awesome. But to me that's what seperates GA from Adobe Analytics (sitecatalyst).

Thanks for the post. Sharing on Twitter. @franciscocmeza

Alex | December 2013

Interesting. Have just upgraded my site to Universal Analytics and wanted to know more about it and how it can be used.

The idea of using it, eventually, to monitor offline behaviour is fascinating. But I guess those concerned about privacy might not be too happy about being “followed“ after they have left a website.

However, if you use a mobile phone or other mobile device, you are being "followed" everywhere anyway.

For a webmaster, UA should prove useful. Now I'm going to have to learn all about Google's Tag Manager too.

Useful post.


Jatinder | January 2014

Thanks for the article Daniel,
I have an question,
Can I Post the Analytics data through HTML form?

Daniel Waisberg | January 2014

The only way available right now is to use the API to build an application that display the data using HTML. If you are not technical, you can use the following integration that enables you publish your Google Analytics data using Google Sites:

Good luck!

Haritha | May 2014


I have a requirment of tracking offline events ,i.e without internet.Is this feature available on UA or do we need to do any customizatiom.

Post new comment
The content of this field is kept private and will not be shown publicly.
Refresh Type the characters you see in this picture.
Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.
Online Behavior © 2012