Introduction to Google Analytics


Full text


Introduction to Google Analytics

Information Services

19 June 2015

Helen Varley Sargan

I don’t profess to be an expert – much of what I do with Google Analytics has been learned on a ‘need to know’ basis and there are areas of it that I ignore – either if I don’t want to use it, don’t understand it or can’t see the relevance. So this introduction is very much on the basis of what I find really useful, but it should be a good way to get you started.

Note: From the end of January 2015 Microsoft Internet Explorer 9 was no longer be supported for use with Google Analytics – you will need to use a newer browser.

Using log analysis and other analytics

If you use logging analysis (that is based on your server logs) alongside Google Analytics you will see that the figures are not directly comparable, although the shape of the graph of usage should be similar. This is because Google Analytics uses client-side code to gather information (depending on JavaScript and

acceptance of cookies), whereas most log files contain only server-side information. Google Analytics does not track spiders and bots. Log files, however, record every time a file is requested, regardless of who requests it. Both are of use but can and do misrepresent what’s going on.

Use of cookies and privacy issues

EU regulations that came into force May 2011 that made it necessary to warn people about cookies being used on your website and, if necessary, give them the opportunity to opt out of their use. This isn’t necessary if the cookie is for business purposes, such as those used by Raven, but is necessary for other types of cookie, including Google Analytics cookies

Google analytics works by sending cookies to the web browser of any user of your pages. For the older asynchronous code these cookies are _utma, _utmb, _utmc and _utmz; for Universal Analytics (from June 2014) there is a single cookie, _ga. Both types of code can be used on pages at the same time.

• The cookies for asynchronous code store information about what time the current visit occurred, whether the visitor has been to the site before, and what site referred the visitor to the web page. With these values, Google Analytics can interpret journeys through content and give you a better idea how people use your site. The cookies last for varying amounts of time, between two years and being removed when you leave the site, and don’t pass any personal information. Google Analytics

information about privacy and cookies may be found at

* The cookie for Universal Analytics stores a unique client identifier (Client ID), which is a randomly generated number. Once the ID is generated it's stored in the cookie and is included with each hit / request sent to Google Analytics. This ID is later used by Google Analytics servers to calculate user, session, and campaign data.

In the ICO’s guidance document about the EU regulations (see link from px) they say the following:

“It is likely to be more difficult to obtain consent for this type of cookie where you do not have any direct relationship with a user – for example where users just visit a site to browse. In this case websites should ensure the information they provide to users about cookies in this area is absolutely clear and is


possible, measures should be put in place to highlight the use of cookies and to try to obtain agreement to set these cookies. There are various ways in which information about cookies can be made — see

‘Providing information about cookies’.

If the information collected about website use is passed to a third party you should make this absolutely clear to the user. You should review what this third party does with the information about your website visitors. You may be able to alter the settings of your account to limit the sharing of your visitor information. Similarly, any options the user has should be prominently displayed and not hidden away.” In the Q & A they also have the following question and answer:

“We only use analytical cookies – if nobody consents that will seriously restrict the amount of information we can get to improve and develop our website

The Regulations do not distinguish between cookies used for analytical activities and those used for other purposes. We do not consider analytical cookies fall within the ‘strictly necessary’ exception criteria. This means in theory websites need to tell people about analytical cookies and gain their consent.

In practice we would expect you to provide clear information to users about analytical cookies and take what steps you can to seek their agreement. This is likely to involve making the argument to show users why these cookies are useful. Although the Information Commissioner cannot completely exclude the possibility of formal action in any area, it is highly unlikely that priority for any formal action would be given to focusing on uses of cookies where there is a low level of intrusiveness and risk of harm to individuals. Provided clear information is given about their activities we are highly unlikely to prioritise first party cookies used only for analytical purposes in any consideration of regulatory action.”

When setting up your analytics account you should opt that Google Analytics does not share your data – you can change to this setting after the account has been set up (see p. 4).

Full details about the GA cookies may be found at

1. Starting with Google analytics

What does it do – see “Expanded information” section for more detail

Google Analytics is free of charge (although there is now a paid-for ‘premium’ service – see It works by the inclusion of a block of JavaScript code on each page in your website. When visitors to your website view a page, this JavaScript causes data about the page request to be collected by the Analytics server.

The data that Google Analytics uses to provide all the information in your reports comes from these sources:

• The HTTP request of the visitor • Browser/system information

• First-party cookies, which collect data about a given browser, along with the information requested and sent by the browser's operator (the visitor)

So the information in Google Analytics tells you about the frequency pages on your website are requested, the journeys users are making through your pages and much other information about where the requests come from. For commercial companies there are emphases on tracking whether advertising campaigns (via AdWords) are successful, and if transactions are being completed, but for non-commercial websites you can learn valuable information about whether links and pages are used and where users enter and leave your site.

The version of Google analytics covered here is ‘Universal analytics’. ‘Universal analytics’ was introduced in 2013 and from 2016 will supersede other tracking code – from mid-2014 it is the only code available for new sites. It uses optional cross-device tracking, using non-cookie technology and the privacy implications of that have not yet been fully explored.

The use of cookies and collected data is well described at universal-analytics-and-cookies/


How you put Google Analytics on a website

All of the following examples should be assumed to be using Universal Analytics unless stated otherwise. • The first thing you need is a Google Analytics identity ( – to get

one you will need a Google account, so if you don't have one you'll have to do that first ( When you log into Google Analytics

( within your Google Analytics administrative area are your

accounts, in which you can track any number of items (web sites, parts or amalgams of websites, which Google calls 'account properties'). You will also see an overview that includes any accounts that you have been given access to and allows you start a new account if you need to.

• If you use Google Apps @ Cambridge for Google Calendar, and are currently Raven-authenticated to it, when you try to log into Google Analytics you will see this:

The link in the top right of the screen will let you sign in with your Google account.


To add a new account, first go to the ‘Admin’ on the right of the toolbar:

Then you will have the opportunity to add a new account (you can have up to 100 accounts):

Setting up a new account

• When you set up the account, you need to fill in details about the name and the URL. Choose an appropriate name, although you can change both it and the URL afterwards. You should also set the location and time, and will also be asked whether you want to share your data. You should uncheck all the options for sharing data. You can modify this setting on a live account by going to the account settings :


Once you have completed the request, and click ‘Get tracking code’ you will see a screen like this, showing you your tracking code:

You can choose to change what you initially requested in the top part of the page, and when saved this will change the code offered below. Your tracking code will look similar to this, but the xxxxxx-x will be your web property id-view number (so the first value will always be xxxxxx-1):


(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//','ga'); ga('create', 'UA-57445568-1', 'auto');

ga('send', 'pageview'); </script>

If you set up your GA property a year or more ago then the code will look different to this.

Starting the GA tracking

• Copy the code, keep a copy safe.

• Paste it into your individual pages, just before the </head> tag – if you don’t add it to a page then it won’t get tracked. If you are using a CMS such as Falcon, you only need to add the tracking code once in the configuration and it will be added to every page (on Falcon it is in Site setup > Site).


Using the GA tracking

To get back to the Admin page, click on the ‘return’ arrow at the top left, next to the new property name

In the right column, the default view for your tracking account is set as ‘All Web Site Data’. Views will be covered on page 8.

Managing users

When you first start your Google Analytics account only you will have access to it. You can opt to give others access to the account, at a number of different levels, or for only particular properties or views. To add others for the whole account, at the admin screen you need to select ‘User management’:

For a new account I just started this screen looks like this:

To add others, in the ‘Add permissions for:’ box I must add their Google account address and then select which account permissions I wish them to have, from this selection:


When you have added them, they will then have access when they log in through - if you add people and give them access to only a property or a view, when you look at the user management for the whole account their account permissions will be listed as ‘Permissions assigned at property or view level’.

Looking at what your account is tracking

The initial set up for the tracking code looks at a single domain. If you need to you can change it by editing a copy of the tracking code and then pasting the amended code into your site. (There is an overview and examples on the page /analyticsjs/domains) This is useful for the following circumstances:

• Tracking across a domain and subdomains • Tracking across multiple domains

• Tracking across a domain and a part of another domain

For instance, if you have a site with 2 subdomains: and, you would configure both trackers as follows:

// Configuration for

ga('create', 'UA-XXXX-Y', {'cookieDomain': ''}); // Configuration for

ga('create', 'UA-XXXX-Y', {'cookieDomain': ''});

In order to then be able to differentiate in reports to which subdomain the request belongs, you will have to add a filter to a copy of the view that adds the URI to each string. See ‘Adding filters’ below for how to do this.

Property settings

There are a few configurations you can make for your property – if you have just set up Google Analytics this will be the only property you have, but later you might have several properties for the same account. To adjust the settings, go to ‘Property Settings’ in the middle column:

At the bottom of that screen there is an option for associating the property with Google Webmaster tools (see p 14), if you have set it up already (you can try using in-page analytics but it isn’t very reliable):


Using views

When you set up a view for a website, data tracking begins as soon as the tracking code is installed on the website and a visitor's browser loads a page. The data is stored in a ‘view’. If, later, you add an additional view, the additional view will not contain the historical data that you see in the view created earlier. For example, suppose in January of 2013 you set up an unfiltered view for your website collecting all traffic for the site. Then in September of 2013, you create an additional view called Sales that only collects data for the /sales directory of the website. If the users of the Sales view attempt to retrieve report information for July of 2011, they will see no data for that time frame. The data does exist in the initial view, but it cannot be copied over to the Sales view.

Unless you need to restrict user access via the reporting views, you might find it unnecessary to set up views purely for the purpose of viewing distinct sections of the site, or for making report viewing more convenient for your account users. In many cases, your users can access the master view and use the

Content Drilldown menu to navigate to their section of the website. Once there, they can also use the Advanced Segments feature of Analytics to filter only the data they are interested in, and even use that as

a means to compare metrics on their set of pages to the entire website. • You may have up to 25 views in any given Analytics account.

• You can provide read access to individual views just for those who are interested in a sub-set of the site. If you want to provide administrative access to other users of an account, those users will be able to see and modify all view data for all websites being tracked in the account.

• You cannot migrate historical data from one account to another. Thus, if you set up an account for a web property and then later want to move tracking to a separate account, you cannot currently migrate the data from the old account to the new account.

Use a Master View

When setting up tracking in an Analytics account, it is a best practice to make the first view for a property (which is automatically added as ‘All Web Site Data ‘) a master view. A master view should have no filters to exclude or include sections of the data from the site being tracked. In this way, you will have a view for the web property that contains all historical data since tracking began. You might want to set up a duplicate of the ‘All Web Site Data’ to keep as an archive.

If you do not retain a master view, but instead have views with filters excluding particular parts of your website, you will not have any data for the parts that have been excluded by the filter. For example, suppose you are mainly interested in tracking visitors to your site from the United States. If you set up a filter on a single view that includes only traffic from the U.S., you will never be able to see pageview data for traffic from anywhere but the U.S.

If you want a filtered view (to provide partial data), add a new view and then exclude certain data. Adjusting View settings – If you click ‘All Web Site Data’ > ‘View settings’, you will see the settings screen. If you wish, you can add the University Site search as a setting. Do this by changing the button under ‘Site search Tracking’ to ‘ON’ and add the query parameter as ‘query’, then save the settings. You will then see the search terms being used from the University site search.

To set up a new view – In your Admin screen for the account, in the right hand (VIEW) column of the screen, go to the popdown box and select ‘Create new view’ :

Call your view a name that supports your intended use for it once filters have been added. We’ll go back to look at views again later.


As an alternative, you can go into ‘All Web Site Data’ > ‘View settings’ and at the top right there is a button to ‘Copy view’.

Adding filters

Adding a filter to a view will allow you to limit and modify the traffic data that is included in a view – predefined filters allow particular content to be included or excluded, or a custom filter can be added that could do a number of different things. An overview of GA filters is at

You can add a filter before or after you create the view, by going to the ‘Filters’ under VIEW or ‘All Filters’ option under ‘ACCOUNT’:

In the UIS views we currently have a number of different filters, for instance, one measuring only the traffic to a particular directory:


In a different account that runs code over a number of subdomains, a custom advanced filter adds the subdomain name to the path of the request (this is an older version of the set up screen for a custom filter but the new screen is fairly similar):

The values used are: Hostname: (.*) Request URI: (.*) Request URI: $A1$B1

More info about custom advanced filters is at with good explanations at

Seeing all filters

If you look in the ‘Account’ column of the admin screen and select ‘All Filters’, you have the opportunity to look at all filters you have added to properties and views.

Seeing Change history

If you look in the ‘Account’ column of the admin screen and select ‘Change History’, you have the opportunity to see all changes that have been made, when they happened and who did them.

Trash Can

A new feature has been added to allow you to recover data within 35 days, if you delete it. For 35 days is can be retrieved from the Trash Can in the ‘Account’ information, after that it has gone for good.

Content groupings

A relatively new facility is available within VIEW to create a ‘Content grouping’ (see for details). These are similar to adding filters but the definition of them is more elastic: you can create them in three ways: • Modify the tracking code on each page you want to group

• Extract pages with regex capture groups • Create rules to include pages in a group


Some reports will have ‘Content grouping’ available as a primary dimension – the metric that is given in a report is for ‘unique views’ rather than ‘page views’, so if there are multiple visits to the same page during a visit that is only counted once.

2. Looking at data

So far we have looked at accounts via the Account Administration view. To see data collected in the accounts, you need to go to ‘Home’ in the top bar (for me there is a long list here – usually there would be only a few):

In the list, select account you want to look at and then click on the appropriate view, which will take you into the ‘Reporting’ section.

You will see a ‘Audience Overview’ page that shows a set of overview information gleaned from the data collected. By default it will show you

• a graph of the last month of data • some site usage statistics

• basic visitor data

On the left side of the page, in the navigation you can access further categories of data about audience, also Real Time use, Acquisition (where your traffic is coming from), Behavior (site content, speed, etc.) and Conversions (goals). At the bottom of the main screen there is access to information about browsers, OS and mobile usage. The categories open and close when you click into and out of them.


You can build a Dashboard of your own to contain widgets showing particular features you want to keep an eye on – if you don’t want to start from scratch you can import dashboards already created by others. You can share your dashboard with others, email it or export it.

You can add Shortcuts to reports you want to view often. You can view Intelligence events

(, set as four reports (overview, daily, weekly and monthly). These events are reported automatically for all data when a significant variation occurs over the different timespans. You can also set up custom alerts of your own, setting the thresholds and items you want to track.

Don’t expect everything to be useful for you. Large sections of Google Analytics are aimed at commercial users, and some I won’t be mentioning. Concentrate on getting data that’s of help. Particular strengths are

• showing data about visitors and usage of particular links, • comparing one period of time with another.

• easy generation of reports

Real -Time

Real-Time > Content gives a view of what is being accessed now and in the last 30 minutes, by device type. You may need to wait a few moments for the traffic to start showing up.

Behavior overview

Behavior > Overview in the left navigation gives some measurements that are similar to Audience > Overview, but also give easy access to many other useful measurements. Most of the options for viewing pageviews for pages are self-explanatory.

Annotate the usage graph

You can annotate a graph point by clicking on the down arrowhead immediately under the graph and ‘+Create new annotation’. You can make annotations that are either private or shared – these are handy to note if there was an event that affected the figures on or after a particular day.

To compare number of requests for two periods of time • click on the down arrow by the date range

• select (or type in) first date range (by default it will be the last month) then check the box ‘Compare to’

• select (or type in) second date range (from custom, previous period or previous year) then check the box ‘Apply’

• If you have failed to match days of the week you can change the dates to make the days match. Your data will now have two values, one for each date range. This can be useful for comparing, say, traffic in a normal termtime week with traffic when an event was announced or happened or registration was occurring.


To see requests for a particular page or directory

Under ‘Behavior’ >‘Site content’, select ‘All pages’. This will show you the first 10 most requested pages – you can alter how many rows you see by changing the popdown box at the bottom of the table.

• At the top of the table you can enter into the search box part of the url you wish to see requests for.

As an example, putting ‘/eduroam’ in the ucs view, the following results were shown:

This manually does what adding a filter or content grouping to a view would do on a permanent basis. If you want to refer to this manually filtered information frequently, you can add it to your dashboard view by selecting ‘Add to Dashboard’ or ‘Shortcut’ at the top of the screen:

Looking at the results, the first link is more popular than the others.

• To find out more about traffic to this page, click on the link to get content detail.

To find information about paths when coming to and leaving this page, click on the ‘Navigation summary’ tab, which gives a breakdown of pages used before and after this one, and also whether people exit at this point.

To find out where the external traffic has come from, go back to the ‘Explorer’ tab and click on ‘Secondary dimension’ > ‘Acquisition’ > ‘Source’ – ‘direct’ means the user either typed in the url, the browser autocompleted it or they followed a bookmark.


What is a bounce?

A "bounce" is a single-page visit to your site. In Analytics, a bounce is calculated specifically as a session that triggers only a single request, such as when a user comes to a single page on your website and then exits without causing any other request to the Analytics server for that session.

A bounce is a different metric than an exit, since the page being examined is the only page visited. There is a full explanation at

The analytics view is that bounces are bad since they show you are losing your user as soon as they arrive. However, for a page imparting a single topic of information or a page people use as their start page, a high bounce rate might be what you expect. For instance the page windows/m8 gives instructions on a very particular subject. Looking further, almost all of the requests are from external sources, most from Google searches.

To see other uses of content

Select ‘Behavior’ > ‘Site content’ >‘Content drilldown’ from left menu to go down through your directories and see which are the most frequently used.

Select ‘Behavior’ > ‘Site content’ >‘Landing pages’ from left menu to where people are entering your site, and select ‘Behavior’ > ‘Site content’ >‘Exit pages’ from left menu to see where they exit.

In-page analytics

In-page analytics in theory should visualise the link usage from your pages, but it is picky about browsers and doesn’t always work.

Advanced segments

To access segments select the pop down arrow in the top of the ‘Acquisition’ or ‘Behavior’ screens. You can apply some default filters to show a breakdown in your visitors by a selection of predetermined criteria (one of which is ‘mobile users’, which can be quite useful) or by creating and applying criteria of your own (for full information see

I have set up a custom segment that gives an approximation of Cambridge users – it uses the Dimension ‘City’ which matches exactly to the value Cambridge.


Using the Chrome extension ‘Page Analytics (by Google)’

This browser extension allows you to see on the page the analytics figures for the various links. It can be either useful or confusing, depending on the page, but can easily be turned on and off (orange icon in top right of screen):

Finding search queries

If you want to see what search terms are being used on your site, and for a number of other useful reasons, you can add Google Webmaster Tools. In the past this was separate from Google Analytics but has now become associated (see p7 for associating it with your Google Analytics account).

The first thing you have to do is go to - this will need your Google log in.

• Go to ‘ADD A PRORERTY’ and add the URL of the site

• You ought to just be able to verify the site, as you are using the new code and you ‘own’ the analytics – if not you will have to add a file to the site to prove your ownership (do this by going to ‘Alternate methods’). If you are a Falcon user, remember to exclude the file from navigation.

• If you are tracking a site that has a site map, it makes sense to add it, as you are then feeding Google all the URLs of your site. For a Falcon site the sitemap is at /sitemap.xml.gz (found via Site setup > Site)

• If you have added a new site it might take a day or so for your new data to start appearing.

There are a number of different items you can look at – to see search terms go to Search traffic > Search Analytics. ‘Impressions’ is the number of times an item appears in search results, and clicks are the number of times they are clicked.

Google webmaster tools is the only way you can remove URLs from the Google index – go to Google index > Remove URLs and you can add a request


Blocking areas of the site from indexing

In Google webmaster tools, if you have allowed a page to be indexed when you didn’t mean it to be available to all, you can remove it from Google but they will expect you also to block indexing to it. Sometimes you won’t have to do this, for instance if you restrict access to the page or remove it, but you can also block pages from being indexed by adding them to a file on your site called robots.txt. This file has to sit at the top level of your site and have a particular syntax to exclude pages or folder (see for general instructions and ones specific for Falcon users)

3. Producing reports

To produce a report of any data, in the Behavior > Site Content > All pages view, you can go to either the ‘Export’ or ‘Email’ tabs in the top of the window and select the appropriate format.

The email option allows you to schedule report sending to a group of users – which may be ideal when you set up a view filtering only a sub-set of your information and you wish to send it regularly to those who requested it.

Customised reporting

You can build your own custom reports if you want to, including specific dimensions and metrics – there is excellent help information at

4. Tracking specific or outward-bound links or downloads

If you have a lot of links that go outwards or are download links, you may like to track how often they are used. On some pages (particularly the home page) you may want to know how many times a particular link is used. In the same way, there are downloadable files for which we would like to know the frequency of use.

The instructions on tell you how to create outbound tracking and those on

1136922?hl=en&ref_topic=1136919 tell you how to track particular links in a page. In both cases the method is different depending on whether you are using the Universal Analytics or the Classic code.

5. Conversions, funnels and goals

If you have some particular targets on your site and you want to measure how often and how effectively they are used and the routes used to get to them, you can extend the above technique and set up a goal and the route you’d expect them to take (see


6. Looking at visitor information

It might be useful for you to know what browsers your visitors are using and how this is changing over time. To do this you Go to ‘Audience’ in the left hand navigation and choose the ‘Technology’ pop-down, and then select ‘Browser & OS’


• There are multiple Primary dimensions available immediately below the graph, so you can see OS, Screen resolution, Screen colours, Flash version and other.

• you can then combine this with a Secondary dimension (in the next line), to show, for instance, browser version, locations of users, whether they are using a mobile device, and so on:


Looking at audience by location

To see you audience location go to Audience > Geo > Location – you initially see the map showing Country/Territory but in the line under the map you can change the Primary Dimension to City, Continent or Sub Continent Region:


Visitors flow

The screen available at Audience >Users Flow gives you a good overview of who is using your pages:

Flow visualization can now use Content grouping (added in May 2014) – see for more information.

7. Data sampling (see ‘Expanded information’ for more detail)

Sampling in Google Analytics or in any web analytics software refers to the practice of selecting a subset

of data from your website traffic: sampling can occur in your reports, during your data collection, or in both places.. Sampling takes place if your site gets a traffic level of over 500k in most reports, unless you are a Premium customer, when you can adjust it.

8. Diagnostics tool

At top right of screen you will find a bell icon, which gives access to the diagnostics tool:

Google Analytics Diagnostics scans for problems every day (with some exceptions). It inspects your site tagging, account configuration, and reporting data for potential data-quality issues. Only users with Edit permission can see and respond to diagnostics messages. Diagnostics honors the first response to a message; for example, when a user ignores a message, it is ignored for all users. Development of the tool is ongoing. More information is available from

9. More help

• General Google Analytics help pages - • GA developer guide -

• Discussion forum -!forum/analytics

• The Analytics Blog is where they announce new features and problems that have occurred: it contains a lot of commercially targeted features -


Expanded information

What does Google analytics do?

The code: Google Analytics works by the inclusion of a block of JavaScript code on pages in your website. When visitors to your website view a page, this JavaScript code references a JavaScript file which then executes the tracking operation for Analytics. The tracking operation retrieves data about the page request through various means and sends this information to the Analytics server via a list of parameters attached to a single-pixel image request.

The data that Google Analytics uses to provide all the information in your reports comes from these sources:

• The HTTP request of the visitor • Browser/system information • First-party cookies

The HTTP request for any web page contains details about the browser and the computer making the request, such as the hostname, the browser type, referrer, and language. In addition, the DOM of most browsers provides access to more detailed browser and system information, such as Java and Flash support and screen resolution. Analytics uses this information in constructing reports like the Map

Overlay, Browser, and Referring Sites reports. Analytics also sets and reads first-party cookies on your

visitors' browsers in order to obtain visitor session and any ad campaign information from the page request. When all this information is collected, it is sent to the Analytics servers in the form of a long list of parameters attached to a single-pixel GIF image request.

For most straightforward websites the standard snippet code positioned at the bottom of the page will work fine. However an alternative form of the code snippet can be used, called the asynchronous snippet. One of the main advantages of the asynchronous snippet is that you can position it at the top of the HTML document. This increases the likelihood that the tracking beacon will be sent before the user leaves the page. See

Cookies: The Classic code and the Universal analytics code use cookies differently – the details are on the page

An HTTP cookie—commonly referred to as just "cookie"—is a parcel of text sent back and forth between a web browser and the server it accesses. Its original purpose was to provide a state management

mechanism between a web browser and a web server. Without a cookie (or a similar solution), a web server cannot distinguish between different users, or determine any relationship between sequential page visits made by the same user. For this reason, cookies are used to differentiate one user from another and to pass information from page to page during a single user's website session. A web server uses cookies to collect data about a given browser, along with the information requested and sent by the browser's operator (the visitor). Cookies do not identify people, but rather they are defined themselves by a combination of a computer, a user account, and a browser.

Asynchronous (classic) code (ga.js): Google Analytics tracking (and most web tracking software) uses cookies in order to provide meaningful reports about your site visitors. However, Google Analytics cookies do not collect personal data about your website visitors.

Functionality Description of Cookie Cookie

Used Setting the Scope

of Your Site Content

Because any cookie read/write access is restricted by a combination of the cookie name and its domain default visitor tracking via Google Analytics is confined to the domain of the page on which the tracking code is installed. For the most common scenario where the tracking code is installed on a single domain (and no other sub-domains) the generic setup is correct. In other situations where you wish to track content across domains or sub-domains , or restrict tracking to a smaller section of a single domain, you use additional methods in the ga.js tracking code to define content scope. See Domains &


Directories in the Collection API document for details. Determining

Visitor Session*

A visitor session ends after 30 minutes of inactivity on your website, or when the browser exits. Google Analytics is able to determine the start of a new session by the absence of either session cookie. You can customize the length of the default session time using the _setSessionCookieTimeout() method.

__utmb __utmc

Identifying Unique

Visitors Each unique browser that visits a page on your site is provided with a unique ID via the __utma cookie. In this way subsequent visits to your website via the same browser are recorded as belonging to the same (unique) visitor. Thus if a person interacted with your website using both Firefox and Internet Explorer, the Analytics reports would track this activity under two unique visitors. Similarly if the same browser were used by two different visitors, but with a separate computer account for each, the activity would be recorded under two unique visitor IDs. On the other hand, if the browser happens to be used by two different people sharing the same computer account, one unique visitor ID is recorded, even though two unique individuals accessed the site.


Tracking Traffic Sources & Navigation

When visitors reach your site via a search engine result, a direct link, or an ad that links to your page, Google Analytics stores the type of referral information in a cookie. The parameters in the cookie value string are parsed and sent in the GIF Request (in the utmcc variable). The expiration date for the cookie is set as 6 months into the future. This cookie gets updated with each subsequent page view to your site; thus it is used to determine visitor navigation within your site.


*Visitor sessions: A user session is defined as the period of visitor inactivity allowed before the session ends. When a user visits a page on your site, a session is established. Session length is determined as follows in these situations:

• The user ceases activity on the page for 30 minutes, and additional activity is attributed to a new session.

• The user exits the page and returns within 30 minutes, and the return visit is counted as part of the original session.

• A user remains actively engaged on the site for 2 hours, and all activity is counted as part of the same session.

User session length is relevant to how unique page views are counted. The unique page view count for a page represents the number of user sessions in which that page was viewed one or more times. For

example, if a user visits your site in a single session and views the same page 10 times, then the page view count for that page will increase by 10. However, the unique page view count for that page will only be 1. Universal analytics code (analytics.js): This code only sets two cookies, both of which are first party. The second one is optional

Functionality Description of Cookie Cookie

Used To distinguish

users An identifier made up of two randomly generated 32-bit numbers (e.g., 12345.67890) is used. It persists for 2 years. Clearing or deleting cookies from a browser does not ensure that subsequent visits to a website will be considered new sessions in Analytics.


To throttle rate request


Details about how to customize the Universal analytics code can be found at - some of these customisations can esily be added to the code when you first request it, but it can be changed afterwards. Universal Analytics introduces new collection technologies to Google Analytics, including the Measurement Protocol. Any site, app, or other digital device or service that implements the collection methods and/or features of the Measurement Protocol is responsible for providing notice and choice to users and

customers according to our Measurement Protocol Policy. If you use a service that has implemented the

Measurement Protocol, please check the notice given and choice offered by this service directly with the Google Analytics customer using such service, as the opt-out directly provided by Google Analytics does not affect data reported through the Measurement Protocol.

The Universal Analytics collection methods (analytics.js and the Measurement Protocol) can be implemented and used to collect user interaction data without cookies.

Data sampling


Sampling in Google Analytics or in any web analytics software refers to the practice of selecting a subset

of data from your website traffic. Sampling is widely used in statistical analysis because analyzing a subset of data gives similar results to analyzing all of the data (see Confidence Interval below). In addition, sampling speeds up processing for reports when the volume of data is so large as to slow down report queries.

If your website has many millions of pageviews per month, sampling the traffic data collection for your site means that you will get good report results in a reasonable amount of time. Even if your site collection is not sampled, certain types of reports will contain sampled results, due to the nature of the query.

1.You can sample data collection for your site traffic by modifing the tracking code snippet on your website. This type of sampling is referred to as client-side sampling. With this kind of sampling, a

percentage of your website traffic is collected rather than all the traffic. You will likely only do this in the case where your website traffic generates excessive pageviews per month for your account. Setting up client-side sampling is different depending on the analytics code you are using – the above link points you to all instructions.

2.Regardless of whether you have traffic collection sampled, Analytics may examine only a sample of the data it has collected when calculating a report. This type of sampling is called report sampling. It occurs automatically when you query for report data that is not available in aggregate.

For example, suppose you query a Content Detail report for your top page, which received 80,000 pageviews over the past month. That information has been automatically compiled in the Analytics database, so the report can quickly display the actual pageview number. However, if you then query that same page for pageviews by browser, you are requesting data that has not automatically been compiled, which means that a special query is needed to do the calculation.

For such a query, Analytics retrieves the data from a set of user sessions. Analytics uses a sample set of 10,000 sessions and estimates the actual number from that sample. This enables Analytics to deliver timely reporting information for large data sets. If the number of sessions being retrieved for that time frame is 10,000 or fewer, no sampling is needed and the actual number is reported.





Related subjects :