Project

General

Profile

« Previous | Next » 

Revision 54609

moved piwik script to index

View differences:

index.html
50 50
    </div>
51 51
  </noscript>
52 52

  
53
  <!-- Piwik -->
54
  <script type="text/javascript">
55
    var piwikUrl;
56
    if ((window.location.origin).includes('beta') ||
57
      (window.location.origin).includes('athenarc') ) {
58
      piwikUrl = 'https://analytics.openaire.eu/piwik.php?idsite=92&rec=1';
59
    } else {
60
      piwikUrl = 'https://analytics.openaire.eu/piwik.php?idsite=111&rec=1';
61
    }
62
    // document.getElementById('piwikImg').setAttribute("src", piwikUrl);
63

  
64
    var _paq = window._paq || [];
65
    /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
66
    _paq.push(['trackPageView']);
67
    _paq.push(['enableLinkTracking']);
68

  
69
    (function() {
70
      /* CREATING PIWIK IMAGE */
71
      dv = document.createElement('div');
72
      dv.setAttribute('style', 'height:0px;');
73
      im = document.createElement('img');
74
      im.setAttribute('src', piwikUrl);
75
      im.setAttribute('style', 'border:0;');
76
      im.setAttribute('alt', '');
77
      dv.appendChild(im);
78
      document.appendChild(dv);
79

  
80

  
81
      /* ORIGINAL TRACKING SCRIPT */
82
      var u="//analytics.openaire.eu/";
83
      _paq.push(['setTrackerUrl', u+'piwik.php']);
84
      if ( (window.location.origin).includes('beta') || (window.location.origin).includes('athenarc') ) {
85
        _paq.push(['setSiteId', '92']);
86
        console.log('92');
87
      } else {
88
        _paq.push(['setSiteId', '111']);
89
        console.log('111');
90
      }
91
      var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
92
      g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
93
    })();
94
  </script>
95
  <!-- End Piwik Code -->
96

  
97
  <!-- PIEIK IMAGE IS NOW CREATED DYNAMICALLY USING JS -->
98
  <!--<div style="height: 0px">
99
    &lt;!&ndash; Piwik Image Tracker&ndash;&gt;
100
    <img id="piwikImg" src="https://analytics.openaire.eu/piwik.php?idsite=92&rec=1" style="border:0" alt="" />
101
    &lt;!&ndash; End Piwik &ndash;&gt;
102
  </div>-->
103

  
104

  
53 105
  <oa-repo-manager>
54 106
    <div uk-spinner="ratio: 2" class="uk-overlay uk-position-center uk-dark" style="margin: auto"></div>
55 107
  </oa-repo-manager>
56 108

  
57

  
58 109
</body>
59 110
</html>

Also available in: Unified diff