How google analytics works

For an online business web visitors are the real customers. These days many online business researching visitors behavior to build their marketing startgies. As google analytics use its visitor tracking technology to track visitor behavior on web pages, so this is the first choice for any start-up,enterprenuer and corporate house. It is the free and efficient data collection method from Google, which is used to track visitors and boost sales.

Note: Google Analytics is used to collect visitor behavior for any websites and blog. Anybody can put Google analytics code into their website or blog to know visitor flow at no cost.

Google Analytics commonly uses ‘Page Tags‘(a JavaScript code) as its data collection technique to record visitors behaviors. In technical terms we can also refer it as Google Analytics Tracking Code (GATC). This short JavaScript code can track any web page in which we wish to integrate this code. However, Google continuously updates its data collection techniques to upgrade its system so please stay updated with its new tracking techniques.

Sample of Google Analytics Tracking Code (GATC):


<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-YYYYYYYY-X']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

How it works:

Step 1:

Google analytics code almost works like client server model(where user request for any web URL from web server and server sends a response to user). In Google analytics when a visitor request for a page from the server then its code begins its processing to collect visitor behavior like the IP address of visitor,country/city of the visitor,its browser environment,type of operating system and many more.

After collecting data, Google Analytics code creates a cookie on visitor system to store collected properties of visitors and waits to send collected data back to Google analytics server. In the process of
collecting visitor data and creating a cookie, the browser download ‘ga.js’ (JavaScript file) in the background.

Note: ‘ga.js’ is a JavaScript file used by Google Analytics server to function all above mentioned process properly. You can view ‘ga.js’ by typing “” in the URL.

Once the ‘ga.js’ file is loaded into the browser,the collected data is sent to Google in the form of ‘Pageview‘. ‘Pageview‘ shows that a visitor has viewed the certain web page on the website. The pageview is transmitted to the Google anaylitcs server via invisible GIF file named as _utm.gif. Every piece of collected information is sent as a query string parameter in the _utm.gif request.

Step 2:

After receiving collected data, Google analytics server stores this data in a log file for further data processing on this collected information. However data collection and data processing is two different components in Google analytics.

Note: Google has not revealed how they store collected data by analytics, so kindly go through Google groups to stumble on this topic.

how google analytics works

Step 3:

After collecting data, Google analytics server process collected data from the log file at some regular intervals(approx 3 to 4 hours). Its processing time can fluctuate. Google analytics does not process data in real time. It normally takes 24 hours after 3 to 4 hours of data processing. Google Analytics is not suitable for real time or intraday reporting as it might lead to inaccurate intraday metrics.

During the processing of data from log file each collected information is split into pieces to process visitor behavior separately such as IP address,city name,operating system and many more. Each pageview has many attributes and that each one is stored in a different field(dimension). By reading these fields(dimension) google analytics uses field(dimension) to build reports. After each line has been broken into fields(dimension),the configuration settings are applied to the data. It includes features such as:

  1. Filters
  2. Goals and funnels
  3. Site search

After applying all settings, the data is stored in the database.

Step 4:

After storing data into the database, Google analytics serve this information as a report to users.

Note: The data processed by Google analytics is never changed when written to database. In other words we can’t change previous visitor behavior data in Google analytics panel.

Uploaded by:  Author