Spot analytics

From MPDLMediaWiki
Jump to navigation Jump to search

Direct Link[edit]


  • 1 Copy the following snippet (!!! THIS SNIPPET WORKS ONLY FOR SPOT!!!):
<!-- Piwik -->
<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(["setCustomVariable", 1, "Institute (from IP)", document.getElementById("instituteNameForIP").value, "visit"]);
  _paq.push(["setCustomVariable", 2, "Institute ID (from IP)", document.getElementById("instituteIdForIP").value, "visit"]);
  if(document.getElementById("instituteNameForUser").value != ''){
    	_paq.push(["setCustomVariable", 3, "User organization (logged in)", document.getElementById("instituteNameForUser").value, "visit"]);
  (function() {
    var u="//";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', 34]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
<noscript><p><img src="//" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->


  • Analytics are done via Piwik by including the javascript tracking code (see [1]). Default analytics are generated automaticcaly
  • For further analytics, we use the [ custom variables] mechanism:
    • Institute (from IP) : Give the institute name according to the IP (see [2]) of the user
    • Institute ID (from IP): Give the institute ID according to the IP (see [3]) of the user
    • User organization (logged in): Give the name of the first Organization of the imeji user (i.e only for logged in users) as defined in imeji

IP tracking[edit]

  • IMPORTANT: No IP will recorded. Piwik uses traoncated IPs, and imeji just read the IP to get the Institute of the user
  • For the mapping of IP of MPIs IP and names, we use supported by MPDL resource:
    • NOTE: Correct processing the list by imeji and piwik from IPs, other than MPDL IP range, can be tested in open library of Max-Planck-Institut für Sozialrecht und Sozialpolitik (4th Stock).
  • When a new User comes into spot, imeji reads the IP and check if the IP is belongs to one MPI (according to the previous list)

Testing issues[edit]