Consent banner
Setup without consent banner
This tiny, 2.8Kb (minzipped) version tracks everyone without asking permission. This is a legal risk because according to ePrivacy directive, all analytics needs a banner for European visitors. However, you might want to use this version in certain scenarios such as when you already have an existing banner system in place.
Paste this code on your website's HTML source code to get the no-banner version up and running:
<!-- Analytics by volument.com --> <script async src="https://cdn.volument.com/v1/volument.js" token="YOUR_TOKEN"></script>
You can see two configuration variables on the script tag:
token
The analytics token you receive after creating a new project. This is required. Tracking is disabled if there is no token.
async
This standard script- tag attribute ensures that the script will be fetched in parallel to parsing and evaluated as soon as it is available. That is: the script won't block the execution of the page and makes the page load faster.
Setup with the consent banner
This 3.5Kb version displays a consent banner for European visitors. ie. the banner is invisible outside Europe. This is the risk-free way to use analytics.
Here's the embed code:
<!-- Analytics by volument.com --> <script async src="https://cdn.volument.com/v1/volument-full.js" token="YOUR_TOKEN"></script>
Consent banner configuration
When you use the banner you must have your privacy policy documents in place. This is how you set up the banner for your own special needs:
<!-- Analytics by volument.com --> <script async src="https://cdn.volument.com/v1/volument-full.js"></script> <script> window.volument_opts = { token: 'YOUR_TOKEN', policy_url: '/privacy-policy', yes_text: 'Okay', // etc.. } </script>
Here are all the available options:
token
The analytics token you receive after creating a new project. This is required.
policy_url
Link to the privacy policy. Default value: https://volument.com/privacy. You should have your document.
link_target
Name of the target window where the privacy policy document is opened. Leaving this empty opens it in the same window. Default value: “policy”
consent_text
The content of the banner. Any text inside brackets becomes a link to the privacy policy. Default value: “Allow [privacy-friendly analytics] to access your device?“
no_text
The label of the “no” button in the consent dialog. The setting is remembered during all the page loads on a visit. Default value: “Not now”
yes_text
The label of the “yes” button in the consent dialog. This setting is remembered forever. Default value: “Yes”
use_css
Whether the default CSS styling should be applied on the popup. Setting this to false
allows you to style the dialog from scratch. Defaults to true
and minimal default styling are applied. You can override the default styles with your CSS.