Use of Google Analytics

Traffic analysis at EPFL can be done free of charge using the Google Analytics tool. Currently, Google Analytics Anonymized is the only tracking tool approved at EPFL . It is deployed on most standard EPFL SI services. To use other tracking tools, please contact the SI.

A general Analytics account is implemented to track all pages under www.epfl.ch.

By using Google Analytics, you agree to the Google Analytics Terms and Conditions, so you allow Google and its partners to use, host, store, reproduce and modify the data it analyzes.

The Law on Protection of Personal Data (LPD Art.18a) forces the webmaster in charge to inform the visitor of any collection of his or her personal data. Thus, it is necessary to anonymize the script provided by Google and to warn Internet users using the below procedure . If you use some VPSI service (WordPress ‘managed’, Actu, Memento, People), these elements are designed by default.

Please read ‘With whom we share your Personal Data‘ (EPFL Privacy policy)

Please follow Google help to create an account

  1. Log on to www.google.com/analytics
  2. Follow Google Analytics instructions
  3. Retrieve the identifier (ID) linked to this account (for example G-xxxxxxxxxx) to implement it on your site.

A Google Account is linked to the person who created it and manages its administrators.
EPFL (or IT support) is unable to know who owns a specific account, or to know its administrators.
If it impossible to know who is in charge of an account, you’ve to contact Google for recovery as in https://support.google.com/analytics/troubleshooter/7264014

You can add your own account on WordPress instances distributed by the VPSI (‘managed’ sites). To do this, you must create your account on Analytics, then implement the code received (“tracking ID”) in the “EPFL Settings” menu of your WordPress site.

We are unable to trace the owners of the accounts thus implemented.

If you manage your own system, you must anonymize the IPs in Google Analytics. Please do the following 2 operations :

  1. Add the anonymization command :

    ga (‘set’, ‘anonymizeIp’, true);

    This command is placed after the “create” command and before the “send” command

  2. Replace the domain name ‘epfl.ch’ with ‘auto’ so that Google Analytics correctly manages the subdomains :

    ga (‘create’, ‘G-xxxxxxxxxx’, ‘auto’);
  3. At the end, you should get a script similar to the example below:

    ga (‘create’, ‘G-xxxxxxxxxx’, ‘auto’)
    ga (‘set’, ‘anonymizeIp’, true);
    ga (‘send’, ‘pageview’);

Warning : for those who still use the (very) old Google script ga.js, instead of analytics.js. We strongly recommend that you update to analytics.js (see documentation below), otherwise you must add the command:

_gaq.push ([‘_gat._anonymizeIp’]);

before order :

_gaq.push ([‘_ trackPageview’]);

assuming that the variable _gaq is the variable containing the parameters for ga.js.

For more info, see official Google documentation.

The link to the legal notices is mandatory on all EPFL public websites.
This link is automatically added to the sites generated by VPSI tools.
For all other sites, the code to add in the footer is :

For the layout, see the example on the home page www.epfl.ch.

Since August 29, 2017, the warning message is installed in the following libraries :

  • www.epfl.ch/css/epfl.css
  • www.epfl.ch/js/globalnav.js
  • www.epfl.ch/js/globalnav-noanalytics.js

This file is automatically added to sites and applications managed by the VPSI.
If your site includes the .css file as well as one of the javascript files mentioned above, it should also appear automatically.
If your site does not include them, you must add the following two libraries which only contain the functionality of the warning message :

  • www.epfl.ch/css/epfl-cookie-consent.css
  • www.epfl.ch/js/epfl-cookie-consent.js

The solution uses a cookie on the epfl.ch domain so as not to repeat the display of the message. This cookie has a lifespan of 365 days.

Follow the tool’s help on the Google support site.