Using Google Analytics to Get Referral and User Activity

A great way to find out where your site visitors come from and what they do on your website according to Polly Pospyelova, Head of Search at Delete Agency, (now Unrvld) is to use Google Analytics cookies.

From these cookies you can extract a wealth of user information which combined with geo location and any other information can help you to build an excellent user profile.

Google Analytics uses cookies to collect user activity data in order to provide meaningful reports about your site visitors. The way Google Analytics does this, is by mainly using first-party cookies. This means that all cookies set by Google Analytics for your domain send data only to the servers for your domain. This effectively makes Google Analytics cookies the personal property of your website’s domain and the data cannot be altered or retrieved by any service on another domain.

Cookies Set by Google Analytics

Session Tracking (__utmb and __utmc)

Google Analytics uses an __utmb cookie to keep track of a user session. This cookie expires in 30 minutes from being set or updated. __utmc cookie is no longer used by the ga.js tracking code but historically, this cookie operated in conjunction with the __utmb cookie to determine whether or not to establish a new session for the user.




  • Domain Hash – domain hash, which does not contain any useful information.
  • Page View Count – number of pages viewed by a visitor during current session.
  • Magic Number – magic Google number which is the same for all websites.
  • Current Session – time when current session started in Unix format. (same as in _utma cookie).

__utma : Unique Visitors

__utma cookie defines a visitor and contains a lot of useful visitor information. This cookie persists for two years (if a user does not delete it), which gives you access to user information for a long time.




  • Domain Hash – domain hash
  • Unique ID – unique ID for Google Analytics.
  • Initial Visit – date of initial visit to the site in Unix format (number of seconds since 1st January 1970).
  • Previous Visit – date of previous visit to the site in Unix format.
  • Current Session – time when current session started in Unix format.
  • Session Number – number of sessions or visits to the site by a unique visitor.

Note: Time on page is determined by taking the time stamp of the current session and subtracting the time stamp of the previous session. In the case of the second page load, it subtracts the current time stamp from the first. If you are on the first page view of the site, all three numbers will be the same.

__utmz : Traffic Sources and Navigation

__utmz cookie is my personal favourite.

It stores information about how visitors reach your web, where they come from (search engine result, direct link, or a link from an email marketing campaign) and keywords they use to find your website (keyword is (not provided) if user was signed into Google or will be (not provided) following Google’s recent move to complete SSL searches). It expires in six months from being set or updated and is updated with every page view.

108243605.1356020566.24.13.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=digital agency


  • Domain Hash – domain hash, which does not contain any useful information.
  • Time stamp – timestamp in Unix format.
  • Total Number of Visits – number of total visits by unique visitor.
  • Total Number of Sources – number of sources used by a unique visitor to reach your site.
  • Search Engine – search engine that the visitor used to reach your site.
  • Campaign – AdWords campaign (or value of utm_campaign URL parameter) or in case of organic traffic it is (organic).
  • Medium – medium (or value of utm_medium URL parameter) which can be paid or organic.
  • Keyword – the keyword that visitor searched in search engine to reach your site; however, this is now available only if visitors came from paid search, organic search keywords are now (not provided).

__utmv : Custom Value

This cookie is only present when you define your own segments for reporting and use the _setCustomVar() method in your tracking code to define custom variables.

___utmx : Google Website Optimizer

This cookie is present when Website Optimizer tracking code is installed for your pages for A/B or multivariate experiments.

What You Can Do with Information from Google Analytics Cookies

Google Analytics cookies are particularly interesting for website owners who want to know more about their visitors or customise user experience based on user activity.

Since cookies can only be accessed from the servers of your domain, you can inspect the information contained in cookies and use it in many different ways.

Custom User Experience

User experience can be customised based on the information received from cookies. You can display content that is relevant to user source, user recency, user loyalty, etc. For example, using it to show special offers to particularly loyal customers or new customers only. Or you can customise page layout/content to reflect a PPC ad which user clicked to reach your site.

Enhanced Leads Validation

Information from cookies can be used to enhance leads, learn more about people who complete goals on your website and improve further marketing to your customer database.

For example, you have a short enquiry form and in order to maximise form completion rate you keep it down to three fields. The only information you will receive when a customer submits this form is Email Address, Telephone and a short Message.

This is pretty much a standard way of receiving leads through forms. But you can find more information about your customer.

With a small script you can read Google Analytics __utma and __utmz cookies and append information from cookies to form when it is submitted.

Visitor submits the same form, but now we can see that they have been to the website 11 times during the last six months, they spent five minutes before submitting the form, they came from a paid Google AdWords campaign and they searched for the keywords ‘best digital agency’.

Furthermore, if an enquiry comes in saying “Hi there, I have been monitoring content on your website for a while…”, but the number of total visits is 1 for this user, you know there is a chance that user is not telling the truth.

You can also append information about the ad shown to this visitor or the web page where the form was submitted from.

But if you are determined to know even more you can introduce Geo API lookup into your process and find out where the visitor who submitted the form is located.

This information can easily be integrated into CRMs, other systems and used for further, more intelligent marketing.

One of my client’s businesses is highly technical and the sales team is small and extremely busy. They wanted to be able to qualify leads better and grade them based on conversion potential before forwarding them into their CRM. Appending information from Google Analytics cookies and Geo API data has helped them prioritise the most valuable leads.

In summary

Google Analytics cookies contain a lot of very useful information which can help you not only provide better user experience to your customers but know your customers and respond to them in the best possible way, so putting these tips into practice can be well worth the time; and this is especially important at a time when Google is restricting the amount of data it gives us in Google Analytics.

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.