Monday, July 27, 2009

How Analytics Packages use Cookies

Whenever web page is opened, most (but not necessarily all) of the content from the domain you are visiting is loaded by browser. When the site you are currently visiting loads a cookie on your system, it is called as a first party cookie. But when many sites run ad banners or pull in other content such as images or content from other sites, then other sites can put a cookie on your computer known as third party cookies.

So what do analytics packages do with cookies? The analytics software requires a method in order to track user sessions on the site. For this JavaScript loads a webpage. When the page loads, it can run, and asks to decide if this is a new user session, a continuation of a current user session, or a first time ever visitor. The process includes:

  1. On loading each of the page check whether the browser on the user's machine has sent the cookie’s data.
  2. If user’s machine has sent the data then:
    • Store in memory the number of visits and the date/time of the last click
    • Analyze the date/time of the last click, and check if more than 30 minutes has passed.
    • If 30 minutes has passed:
      • Increase the number of visits in the cookie by 1
      • Mention the date/time of the current visit to the cookie
    • If no:
      • Do not change the number of visits in the cookie
      • Mention the date/time of the current visit to the cookie
  1. If machine has not sent the data then:
    1. Set the number of visits in the cookie to 1
    2. Write the date/time of the current visit to the cookie
This describes only a way that cookies can be used to store data. Some analytics packages simply use the cookie as an index into an internal data store where the visitor history details are stored. But the basic process remains the same. Contact US

3 comments:

  1. i like its concept and how it works..much easy to track and analyze how things works out..
    _____________
    seo package

    ReplyDelete