Examples of Web Analytics Code (Matomo, formerly “Piwik”)

26 views
Skip to first unread message

Sherry Lake

unread,
Jul 11, 2019, 10:06:03 AM7/11/19
to Dataverse Users Community
Is anyone using Matomo (Piwik) for Dataverse website analytics?

If so, would you mind sharing your analytics-code.html file.

Thanks.
Sherry Lake

Sherry Lake | Scholarly Repository Librarian | University of Virginia Library | shL...@virginia.edu | 434.924.6730@shLakeUVA | Alderman Library, 160 N. McCormick Road, Charlottesville, VA 22903 | Alderman 563 | LinkedIn Profile | id:image001.png@01D378D7.2892FDE0orcid.org/0000-0002-5660-2970  | “Keeper of the Dataverse"



Philip Durbin

unread,
Jul 11, 2019, 10:48:58 AM7/11/19
to dataverse...@googlegroups.com
Hi Sherry,

I just did a "view source" of https://catalogues.cdsp.sciences-po.fr and found the code below.

I also pinged Jeremy Richard who originally contributed this feature (thanks again!): http://irclog.iq.harvard.edu/dataverse/2019-07-11#i_100578

I hope this helps,

Phil

p.s. The code I found:

         <script type="text/javascript">
         var _paq = _paq || [];
         _paq.push(['trackPageView']);
         _paq.push(['enableLinkTracking']);
         (function() {
             var u="//cdsp.sciences-po.fr/stats/";
             _paq.push(['setTrackerUrl', u+'piwik.php']);
             _paq.push(['setSiteId', 5]);
             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);
         })();
         </script>
         <noscript><p><img src="//cdsp.sciences-po.fr/stats/piwik.php?idsite=5" style="border:0;" alt="" /></p></noscript>

--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To post to this group, send email to dataverse...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/3cc6d065-14bb-453e-a00b-aa944b6e494d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Sherry Lake

unread,
Jul 12, 2019, 9:59:44 AM7/12/19
to Dataverse Users Community
Thanks, Phil.

Finally got an answer from our UX folks (one's who admin our Matomo account). The script can be copied from the Dashboard of the Matomo site (from the specific website) - here: From settings - choose "Tracking Code".

--
Sherry
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-community+unsub...@googlegroups.com.

Juan Corrales

unread,
Jul 16, 2019, 2:55:02 AM7/16/19
to Dataverse Users Community
Hi Sherry,

  we have added a line to the standard Matomo Tracking Code to count downloads too. We counts as download each click in links belonging to the css class "btn-download".
  
  Juan

<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['setDownloadClasses', "btn-download"]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
            var u="//piwik.consorciomadrono.es/piwik/";
            var t="piwik";
            _paq.push(['setTrackerUrl', u+t+'.php']);
            _paq.push(['setSiteId', 1]);
            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+t+'.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript>
     <p><img src="//piwik.consorciomadrono.es/piwik/piwik.php?idsite=1" style="border:0;" alt="" /></p>
</noscript>

Reply all
Reply to author
Forward
0 new messages