piwik.bfh.ch: Setup

Web Settings

Manage / Websites

  • Default Currency for new websites: Swiss franc (Fr)


Add IPs of Webmasters of a certain site to the exclude list that site.

Manage / User settings

  • Report to load by default: All Websites dashboard
  • Report date to load by default: Yesterday

Settings / General settings

  • Allow Piwik archiving to trigger when reports are viewed from the browser: No
  • Reports for today (or any other Date Range including today) will be processed at most every: 3600 seconds
  • Trusted Piwik Hostname: web-statistics.bfh.ch

Settings / Privacy

  • Anonymize Visitors’ IP addresses: yes

Settings / Geolocation

  • GeoIP (PECL): enabled

Platform / Plugins

  • DevicesDetection: enabled
  • Feedback: disabled

Manual Settings


  • memory_limit = 512M


  • browser_archiving_disabled_enforce = 1


Tracking Code

Remember to replace the ${FQDN} with your fully qualified domain name (FQDN), e.g. www.bfh.ch, and ${SITEID} with the corresponding piwik site id from the table below, e.g. 1 for www.bfh.ch.

Image Tracking Code

Insert the following code as the first thing in your html page, right after the <body> tag.

     <div style="display: none;">
          <img src="https://web-statistics.bfh.ch/${FQDN}/tracker.php?idsite=${SITEID}&rec=1" style="border:0" alt="" />

Java Script Tracking Code

Insert the following code as the last thing in your html page, right before the </body> tag.

<script type="text/javascript">
    (function() {
            function async_load(){
                var s = document.createElement('script');
            var u = (("https:" == document.location.protocol) ? "https://web-statistics.bfh.ch/" : "http://web-statistics.bfh.ch/");
                s.type = 'text/javascript';
            s.async = true;
                s.src = u+'${FQDN}/tracker.js';
            var x = document.getElementsByTagName('script')[0];
                x.parentNode.insertBefore(s, x);
        window.attachEvent ? window.attachEvent('onload', async_load) : window.addEventListener('load', async_load, false);

How to add a new website in Piwik

New websites can be setup to be tracked in Piwik by Daniel, Philipp, and Derek as they have the proper permissions to do the following:

  • log into Piwik as sysadmin (password in passwords.its.bfh.ch.
  • click on Settings / Manage / Websites / Add a new website to add a new website and add it.
  • clone piwik.git.
  • copy the TEMPLATE directory to your new websites name (beware of the symlinks inside, use cp -a).
  • replace @SITE_ID@ with the site id integer you got when you added the website in the Piwik webgui.
  • by convention and for consistency we prefix the website name (both in the Piwik webgui and in the configuration repo) with www if the website is reachable with it.
  • commit and push the repository.
  • enable the tracking codes in your html.


  • bad9: db improvements
  • bad9: ldap auth
  • gbs4: piwik opt-out and impressum
  • gbs4: google analytics way out