Saturday, July 14, 2007

FDIM and third party cookies

pencil icon, that"s clickable to start editing the post

The Association of Danish Internet Medias (FDIM) which is responsible for a Danish Internet traffic and audience measurement system. There's a short info page on FDIM in english.

The current tracking system is about to be phased out and replaced by a new one. Both systems are enabled on the info page. The first one from Gallup is inserted like:

<script type="text/javascript">
<!--
var tmsec = new Array ('tmsec=fdim');
getTMqs('http', '', '', 'fdim_dk', 'dk', 'ISO-8859-15', tmsec);
//-->
</script>
<noscript>
  <img src="http://statistik-gallup.net/V11***fdim_dk/dk/ISO-8859-15/tmsec=fdim/">
</noscript>

This uses a classic third part cookie to the domain statistik-gallup.net. Since this system is be phased out I'll no go deeper into that.

The new audience measurement setup with Gemius Audience:

<!-- (C)2000-2006 Gemius SA - gemiusAudience / fdim.dk / Main Page -->
<script type="text/javascript">
var pp_gemius_identifier = new String('zNrq9nyrPxWCP8HNpip1JsQKjzMy_1tV8XABkQa9y_j.A7');
</script>
<script type="text/javascript" src="http://www.fdim.dk/xgemius.js"></script>

Where the JavaScript file is a very simple 70 liner (compared to the GA which is more that 10 fold larger):

    1 // (c) 2000-2007 by Gemius SA
    2 
    3 function gemius_parameters() {
    4   var d=document;
    5   var href=new String(d.location.href);
    6   var ref;
    7   if (d.referrer) { ref = new String(d.referrer); } else { ref = ""; }
    8   var t=typeof Error;
    9   if(t!='undefined') {
   10     eval("try { if (typeof(top.document.referrer)=='string') { ref = top.document.referrer } } catch(gemius_ex) { }")
   11   }
   12   var url='&tz='+(new Date()).getTimezoneOffset()+'&href='+escape(href.substring(0,299))+'&ref='+escape(ref.substring(0,299));
   13   if (screen) {
   14     var s=screen;
   15     if (s.width) url+='&screen='+s.width+'x'+s.height;
   16     if (s.colorDepth) url+='&col='+s.colorDepth;
   17   }
   18   return url;
   19 }
   20 
   21 function gemius_append_script(xp_url) {
   22   if(typeof Error !='undefined') {
   23     eval("try { xp_javascript = document.createElement('script'); xp_javascript.src = xp_url; xp_javascript.type = 'text/javascript'; xp_javascript.defer = true; document.body.appendChild(xp_javascript); } catch(exception) { }");
   24   }
   25 }
   26 
   27 function gemius_load_script() {
   28   if (window.pp_gemius_image.width && window.pp_gemius_image.width>1) {
   29     gemius_append_script(window.pp_gemius_script);
   30   }
   31   if (document.location && document.location.protocol=='http:' && window.pp_gemius_image.height && window.pp_gemius_image.height>1) {
   32     gemius_append_script('http://ndk.hit.gemius.pl/nosb.js');
   33   }
   34 }
   35 
   36 if (typeof pp_gemius_identifier == 'undefined') {
   37   if (typeof gemius_identifier != 'undefined') {
   38     pp_gemius_identifier = gemius_identifier;
   39     gemius_identifier = 'USED_'+gemius_identifier;
   40   } else {
   41     pp_gemius_identifier = "";
   42   }
   43 }
   44 
   45 var gemius_proto;
   46 if(document.location && document.location.protocol) {
   47   gemius_proto = 'http'+((document.location.protocol=='https:')?'s':'')+':';
   48 } else {
   49   gemius_proto = 'http:';
   50 }
   51 var pp_gemius_host = gemius_proto+'//gadk.hit.gemius.pl/_'+(new Date()).getTime();
   52 
   53 if (typeof window.pp_gemius_image != 'undefined') {
   54   if (typeof window.pp_gemius_images == 'undefined') {
   55           window.pp_gemius_images = new Array();
   56   }
   57   var gemius_l = window.pp_gemius_images.length;
   58   window.pp_gemius_images[gemius_l]=new Image();
   59   window.pp_gemius_images[gemius_l].src = pp_gemius_host+'/redot.gif?id=ERR_'+pp_gemius_identifier+gemius_parameters();
   60 } else {
   61   if (window.attachEvent) {
   62     window.attachEvent("onload", gemius_load_script);
   63   } else if(window.addEventListener) {
   64     window.addEventListener("load", gemius_load_script, false);
   65   }
   66   window.pp_gemius_image = new Image();
   67   window.pp_gemius_image.src = pp_gemius_host+'/rexdot.gif?l=11&id='+pp_gemius_identifier+gemius_parameters();
   68   window.pp_gemius_script = pp_gemius_host+'/pp.js?id='+pp_gemius_identifier;
   69 }
   70 pp_gemius_identifier = 'USED_'+pp_gemius_identifier;
   71 

With meaningful names it is also much more readable than the GA - I can't tell if the feature set for GA is much larger than Gemius, since that could be an argument for the more complex JavaScript for GA.

A visit to the info page confronts me with five cookies:

Gallup Cookie
A cookie from/to the specific host statistik-gallup.dk.


This is four domain cookies to .hit.gemius.pl (host ndk.hit.gemius.pl) which also uses third part cookies which potentially ruin some of the data quality, but they seem to be using P3P since a simple GET to http://ndk.hit.gemius.pl shows the usage of a compact P3P policy, which opens up for using third part cookies with IE (Firefox in general don't care):

wget -S http://ndk.hit.gemius.pl
--21:47:57--  http://ndk.hit.gemius.pl/
Resolving ndk.hit.gemius.pl... 81.19.234.252
Connecting to ndk.hit.gemius.pl|81.19.234.252|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Date: Sat, 14 Jul 2007 19:47:57 GMT
  Expires: Sat, 14 Jul 2007 20:47:57 GMT
  Accept-Ranges: none
  Cache-Control: max-age=3600
  Last-Modified: Thu, 31 May 2007 08:34:54 GMT
  P3P: CP="NOI DSP COR NID PSAo OUR IND"
  Connection: close
  Content-Type: text/html;charset=utf-8
  Content-Length: 55
Length: 55 [text/html]

It's time to have a quick look at P3P.

0 comments :