Using UniConsent Script (UnicScript) to manage on page elements

You can manage the on-page elements with UnicScript and load the tag based on the consent of purpose ID or custom vendor ID.

Purpose IDDescription
1Store and/or access information on a device
2Select basic ads
3Create a personalised ads profile
4Select personalised ads
5Create a personalised content profile
6Select personalised content
7Measure ad performance
8Measure content performance
9Apply market research to generate audience insights
10Develop and improve products

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>

Manage Google Adsense with UnicScript

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>

Still have questions?

Contact us: support@uniconsent.com