You can manage the on-page elements with UnicScript and load the tag based on the consent of purpose ID or custom vendor ID. (IAB TCF 2.2 Purposes)
Purpose ID | Description |
---|---|
1 | Store and/or access information on a device |
2 | Use limited data to select advertising |
3 | Create profiles for personalised advertising |
4 | Use profiles to select personalised advertising |
5 | Create profiles to personalise content |
6 | Use profiles to select personalised content |
7 | Measure advertising performance |
8 | Measure content performance |
9 | Understand audiences through statistics or combinations of data from different sources |
10 | Develop and improve services |
11 | Use limited data to select content |
Example:
<script type="text/unicscript" unic-purpose-id="1">
console.log('hello purpose 1');
</script>
Example 2:
<script type="text/unicscript" unic-purpose-id="1" src="xxxxx"></script>
Example:
<script type="text/unicscript" unic-purpose-ids="1,2,3">
console.log('hello purpose 1,2,3');
</script>
Example:
<script type="text/unicscript" unic-vendor-id="1">
console.log('hello vendor 1');
</script>
Example 2:
<script type="text/unicscript" unic-vendor-id="1" src="xxxxx"></script>
Example:
<iframe
data-unicscript
unic-purpose-id="1"
width="560"
height="315"
data-src="https://www.youtube.com/embed/XXXX"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
Example:
<iframe
data-unicscript
unic-purpose-id="1,2,3"
width="560"
height="315"
data-src="https://www.youtube.com/embed/XXXX"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
Example:
<iframe
unic-vendor-id="1"
width="560"
height="315"
data-src="https://www.youtube.com/embed/XXXX"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
Change:
<script
async
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
type="text/javascript"
></script>
to be:
<script
async
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
unic-purpose-id="3"
type="text/unicscript"
></script>
Modify the Google Adsense ad slot tag adding on page, change:
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-XXXXXX" data-ad-slot="XXXXXXX" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="text/javascript">
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
to be:
<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-XXXXXX" data-ad-slot="XXXXXXX" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script type="text/unicscript" unic-purpose-id="3" >
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Contact us: support@uniconsent.com