CMP script tag integration (Clickio specific)

By default, all publishers are encouraged to use the standard TCF v2.2 API (__tcfapi) to get end-user consent information, such as per-vendor settings, specific purposes consent, etc. However, Clickio Consent also offers simplified method for publishers' convenience.

By default, __tcfapi is not available for non-EEA users for optimization reasons. If you choose to utilize it or want to have it anyway, please contact our support.

 

Clickio simplified integration

To pause script tags execution before user consent is obtained, we offer a simplified solution, which also allows additional consent data checks before the script is executed

This solution is fine for most cases, but if you can integrate using TCF or Clickio APIs, it is better to use those approaches, as those provide more granular control over the process and consent data

If you plan to pause script tags with src attribute, consider preloading those with:
<link rel="preload" href="%scipr_src_here%" as="script" />
to minimize delays when script is executed

Only script tags with attribute async are processed by the Consent tool logic, as the code itself is executed asynchronously, please double-check to prevent erroneous behavior (scripts without attribute will not be executed, execution logic may change on async script execution)

 
Pausing script tag before user choice is obtained

For example you have the following code on your site (works the same way for tags with src attribute):

<script type="text/javascript">
console.log('user choice obtained');
</script>

1. Add async attribute to the tag

2. Set tag type attribute to text/clickiocmp

Resulting code:

<script async type="text/clickiocmp">
console.log('user choice obtained');
</script>

This code will be executed automatically when the user choice is determined (user consented or consent not applicable).

 

To implement different logic for GDPR and non-GDPR users, the data-clickio-cmp-gdpr attribute can be added to the script tag. It have value of 1 to be executed for GDPR users and 0 to be executed for non-GDPR users.

Example:

<script async type="text/clickiocmp" data-clickio-cmp-gdpr="1">
console.log('GDPR user');
</script>

<script async type="text/clickiocmp" data-clickio-cmp-gdpr="0">
console.log('Non-GDPR user');
</script>

 

To fine-control script execution conditions we have provided several additional attributes:

All the following attributes checks always pass for non-GDPR users.

Any of the following attributes can be combined with the data-clickio-cmp-gdpr attribute.

The following attributes can be combined and the check is performed with AND condition.

 
data-clickio-cmp-purpose-consent

Can be an integer or a comma separated list of integers of IDs of IAB specified purposes for which consent is mandatory for script execution.

Example:

<script async type="text/clickiocmp" data-clickio-cmp-purpose-consent="1">
console.log('user consent for purpose 1 obtained');
</script>

 

data-clickio-cmp-purpose-li

Can be an integer or a comma separated list of integers of IDs of IAB specified purposes for which legitimate interest approval is mandatory for script execution. If consent was given for the purposes the check also passes.

Example:

<script async type="text/clickiocmp" data-clickio-cmp-purpose-li="2,7,9,10">
console.log('user approved legitimate interest for purposes 2, 7, 9 and 10');
</script>

 

data-clickio-cmp-vendor-consent

Can be an integer or a comma separated list of integers of IDs of IAB vendors for which consent is mandatory for script execution.

Example:

<script async type="text/clickiocmp" data-clickio-cmp-vendor-consent="755">
console.log('user consent for Google Inc. (id:755) obtained');
</script>

 

data-clickio-cmp-vendor-li

Can be an integer or a comma separated list of integers of IDs of IAB vendors for which legitimate interest approval is mandatory for script execution. If consent was given for the vendors the check also passes.

Example:

<script async type="text/clickiocmp" data-clickio-cmp-vendor-li="755">
console.log('user approved legitimate interest for Google Inc. (id:755)');
</script>