Measurements (e.g. Google Analytics)
If you are comfortable using Jekyll, then you can simple add it as you see fit. Remember to get the website users consent.
To make it easier we have added a simple way to add Google Analytics. You can configure this to use another analytics provider if you wish to.
Google analytics is being used on this site if the user accept the privacy terms. If you have already accepted or rejected the privacy terms, then you no longer see the popup. To see it again you need to remove the stored preference for this site.
Create a Google Analytics ID
You need to go to https://analytics.google.com/ and create an analytics property.
Add following to your
# The text for the terms can be changed by adding translations for 'terms', 'acceptTerms' and 'rejectTerms' in `/_data/translations.yml`. siteMeasurements: enable: true # When enabled there will be a popup asking the user for their consent. If they accept then the function "attachMeasurements" will be called. You can overwrite this function by adding a file `/_includes/js/measure.js` and replace the function. GA_ID: "G-XXXXXXXXXX" # Your Google analytics ID. Sometimes they start with UA-XXXXX-X other times with G-XXXXXXXX depending on how you set it up termsVersion: "2021-07-06" # A version number for your terms. If you change this, then the users will see the popup again asking them to confirm/reject anew.
Add popup text
Secondly you need to provide the text for the popup. You do so in
Overwrite the default tracking scripts
When the user accept the terms then a function is called that attach the measurement scripts.
This function is called when the user clicks
accept and on subsequent pages if the cookie (or rather localStorage variable has been set. The users consent/rejection is stored in local storage as
If they accept then the function “attachMeasurements” will be called. You can overwrite this function by adding a file
/_includes/js/measure.js and replace the function.