How to integrate Clickio Consent with Matomo Web Analytics
Choose one consent handling script suitable for your Clickio Consent regulation setup and install it inside the <head>
tag before the main Matomo Web Analytics JavaScript Tracker code:
GDPR-only regulation
Use this script if only the GDPR (TCF or non-TCF) regulation is enabled in the Clickio Consent settings.
<!-- Matomo consent handling for Clickio Consent -->
<!-- Enable Consent-based Tracking in Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['requireConsent']);
var matomo_consent_given = false;
</script>
<!-- GDPR scope user + TCF mode
User approved TCF purposes: 1, 8, 9 -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="1" data-clickio-cmp-purpose-consent="1,8,9">
matomo_consent_given = true;
</script>
<!-- GDPR scope user + Non-TCF mode
User approved non-TCF purpose: Website Analytics (id:2) -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="1" data-clickio-cmp-nontcf-purpose-consent="2" >
matomo_consent_given = true;
</script>
<!-- User outside the GDPR scope that is chosen in the Consent settings -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="0">
matomo_consent_given = true;
</script>
<!-- Set Consent state for Matomo -->
<script type="text/clickiocmp">
if(matomo_consent_given) {
_paq.push(['setConsentGiven']);
} else {
_paq.push(['forgetConsentGiven']);
}
</script>
<!-- / End Matomo consent handling for Clickio Consent -->
GDPR & US regulations
Use this script if both GDPR and US regulations are enabled in the Clickio Consent settings.
<!-- Matomo consent handling for Clickio Consent -->
<!-- Enable Consent-based Tracking in Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['requireConsent']);
var matomo_consent_given = false;
</script>
<!-- GDPR scope user + TCF mode
User approved TCF purposes: 1, 8, 9 -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="1" data-clickio-cmp-purpose-consent="1,8,9">
matomo_consent_given = true;
</script>
<!-- GDPR scope user + Non-TCF mode
User approved non-TCF purpose: Website Analytics (id:2) -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="1" data-clickio-cmp-nontcf-purpose-consent="2" >
matomo_consent_given = true;
</script>
<!-- User outside the GDPR scope that is chosen in the Consent settings -->
<script type="text/clickiocmp" data-clickio-cmp-gdpr="0">
matomo_consent_given = true;
</script>
<!-- Users from applicable US states who have not opted out -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="1" data-clickio-cmp-usnat-opted-out="0">
matomo_consent_given = true;
</script>
<!-- Users from applicable US states who have opted out -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="1" data-clickio-cmp-usnat-opted-out="1">
matomo_consent_given = false;
</script>
<!-- Users from US but not from applicable states -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="0">
matomo_consent_given = true;
</script>
<!-- Set Consent state for Matomo -->
<script type="text/clickiocmp">
if(matomo_consent_given) {
_paq.push(['setConsentGiven']);
} else {
_paq.push(['forgetConsentGiven']);
}
</script>
<!-- / End Matomo consent handling for Clickio Consent -->
US-only regulation
Use this script if only the US regulation is enabled in the Clickio Consent settings.
<!-- Matomo consent handling for Clickio Consent -->
<!-- Fallback for non-US users -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
_paq.push(['requireConsent']);
_paq.push(['setConsentGiven']);
</script>
<!-- Enable Consent-based Tracking in Matomo -->
<script type="text/clickiocmp">
var matomo_consent_given = false;
</script>
<!-- Users from applicable US states who have not opted out -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="1" data-clickio-cmp-usnat-opted-out="0">
matomo_consent_given = true;
</script>
<!-- Users from applicable US states who have opted out -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="1" data-clickio-cmp-usnat-opted-out="1">
matomo_consent_given = false;
</script>
<!-- Users from US but not from applicable states -->
<script type="text/clickiocmp" data-clickio-cmp-usnat="0">
matomo_consent_given = true;
</script>
<!-- Set Consent state for Matomo -->
<script type="text/clickiocmp">
if(matomo_consent_given) {
_paq.push(['setConsentGiven']);
} else {
_paq.push(['forgetConsentGiven']);
}
</script>
<!-- / End Matomo consent handling for Clickio Consent -->