Bonjour,

Parfois il est aisé d’ajouter un suivi statistique à son site Drupal via un module dédié, mais ce n’est pas le cas de Xiti ou Quantcast.

Pour se faire j’ai créé un petit fichier php qui contient le code des dis tracker :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!-- code XITI  -->
<div id="xiti-logo">
<script type="text/javascript">
<!--
document.write('<a href="http://www.xiti.com/xiti.asp?s=451669" title="WebAnalytics">');
Xt_param = 's=XXXXX&p=<?php echo $head_title; ?>';
try {Xt_r = top.document.referrer;}
catch(e) {Xt_r = document.referrer; }
Xt_h = new Date();
Xt_i = '<img width="39" height="25" border="0" ';
Xt_i += 'src="http://logv11.xiti.com/hit.xiti?'+Xt_param;
Xt_i += '&hl='+Xt_h.getHours()+'x'+Xt_h.getMinutes()+'x'+Xt_h.getSeconds();
if(parseFloat(navigator.appVersion)>=4)
{Xt_s=screen;Xt_i+='&r='+Xt_s.width+'x'+Xt_s.height+'x'+Xt_s.pixelDepth+'x'+Xt_s.colorDepth;}
document.write(Xt_i+'&ref='+Xt_r.replace(/[<>"]/g, '').replace(/&/g, '$')+'"></a>');
//-->
</script>
<noscript>
<div id="xiti-logo-noscript">
<a href="http://www.xiti.com/xiti.asp?s=XXXX" title="WebAnalytics" >WebAnalytics solution by <img width="39" height="25" src="http://logv11.xiti.com/hit.xiti?s=451669&amp;p=<?php echo $head_title; ?>&amp;" alt="WebAnalytics" /></a>
</div>
</noscript>
</div>
 
<!-- Start Quantcast tag -->
<script type="text/javascript">
_qoptions={
qacct:"XXXX"
};
</script>
<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
 
<noscript>
<img src="http://pixel.quantserve.com/pixel/p-behZUd_cXqsz-.gif" border="0" height="1" width="1" alt="Quantcast"/>
</noscript>
<!-- End Quantcast tag -->

ensuite il faut insérer ce fichier dans les divers template de Drupal avec l’extension .tpl.php via un include php.Et voila vos stats seront prisent en compte par le tracker dans les 24/48H qui suivent…