Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Overview

To use AdConsent in a publisher's page, without AdEngine, needs the following steps to be implemented in the page <head> section:

  1. Include the AdConsent script in the document <head> section before any ad technology script. The script must be loaded synchronously to avoid race conditions while loading the page with scripts using the privacy API from AdConsent.

  2. Set AdConsent visual adjustments to fit the page look and feel, as well as the configurations needed to make AdConsent compatible with the publisher's privacy requirements. For more information regarding available AdConsent functions, check the AdConsent API reference.

  3. Signal AdConsent to start through the AdConsent start command.

  4. (optional) Load 3rd party ad technology scripts like AdSense.

Examples

Starting AdConsent in default mode

Example using AdConsent with all default options. Consider using the AdConsent typical setup example.

<!-- AdConsent section -->
<script src="//cdn.snigelweb.com/adconsent/adconsent.js" type="text/javascript"></script>
<script>
  adconsent('start');
</script>

Typical AdConsent setup

This is the typical AdConsent setup used. Use this example, customize styles to your need and change the AdConsent option example values:

  • setPublisherCC. Two uppercase letter country code of the country that determines the legislation of reference. Normally corresponds to the country code of the country in which the publisher's business entity is established.

  • setPrivacyPolicy. The link to your privacy policy page

  • setLogo. The link to your logo that is displayed in the AdConsent GDPR GUI.

<!-- AdConsent loading tag -->
<script src="//cdn.snigelweb.com/adconsent/adconsent.js" type="text/javascript"></script>
<!-- AdConsent style tag -->
<style>
#snigel-cmp-framework .sn-b-def.sn-blue {color: #ffffff!important;background-color: #af0e0e!important;border-color: #af0e0e!important;}
#snigel-cmp-framework .sn-b-def { border-color: #af0e0e!important;color: #af0e0e!important;}
#snigel-cmp-framework .sn-selector ul li { color: #af0e0e!important}
#snigel-cmp-framework .sn-selector ul li:after { background-color: #af0e0e!important; }
#snigel-cmp-framework .sn-footer-tab .sn-privacy a {color:#af0e0e!important;}
#snigel-cmp-framework .sn-arrow:after, #snigel-cmp-framework .sn-arrow:before { background-color: #af0e0e!important; }
#snigel-cmp-framework .sn-switch input:checked+span::before { background-color: #af0e0e!important; }
#adconsent-usp-link {border: 1px solid #af0e0e!important;color: #af0e0e!important;}
#adconsent-usp-banner-optout input:checked+.adconsent-usp-slider {background-color:#af0e0e!important;}
#adconsent-usp-banner-btn {color:#ffffff;border: solid 1px #af0e0e!important;background-color: #af0e0e!important;}
</style>
<!-- AdConsent configuration tag -->
<script>
  adconsent('setPublisherCC', 'DE');
  adconsent('setPrivacyPolicy', '//www.mysite.com/privacy');
  adconsent.gdpr('setLogo', '//www.mysite.com/logo.jpg');
  adconsent.gdpr('enableWelcomeTitle');
  adconsent.gdpr('enableWelcomeText');
  adconsent.gdpr('reconsiderConsent', 48);
  adconsent('start');
</script>

Starting AdConsent with Google Analytics enabled and a logo for the TCF 2.0 CMP

<!-- AdConsent loading tag -->
<script src="//cdn.snigelweb.com/adconsent/adconsent.js" type="text/javascript"></script>
<!-- AdConsent configuration tag -->
<script>
  adconsent('setPublisherCC', 'US');
  adconsent('enableGoogleAnalytics', true);
  adconsent.gdpr('setLogo', '//www.mysite.com/logo.jpg');
  adconsent('start');
</script>

Starting AdConsent with visual styles, a specific privacy policy link for each privacy law and with consent reconsideration after 48h

<!-- AdConsent loading tag -->
<script src="//cdn.snigelweb.com/adconsent/adconsent.js" type="text/javascript"></script>
<!-- AdConsent style tag -->
<style>
#snigel-cmp-framework .sn-b-def.sn-blue {color: #ffffff!important;background-color: #af0e0e!important;border-color: #af0e0e!important;}
#snigel-cmp-framework .sn-b-def { border-color: #af0e0e!important;color: #af0e0e!important;}
#snigel-cmp-framework .sn-selector ul li { color: #af0e0e!important}
#snigel-cmp-framework .sn-selector ul li:after { background-color: #af0e0e!important; }
#snigel-cmp-framework .sn-footer-tab .sn-privacy a {color:#af0e0e!important;}
#snigel-cmp-framework .sn-arrow:after, #snigel-cmp-framework .sn-arrow:before { background-color: #af0e0e!important; }
#snigel-cmp-framework .sn-switch input:checked+span::before { background-color: #af0e0e!important; }
#adconsent-usp-link {border: 1px solid #af0e0e!important;color: #af0e0e!important;}
#adconsent-usp-banner-optout input:checked+.adconsent-usp-slider {background-color:#af0e0e!important;}
#adconsent-usp-banner-btn {color:#ffffff;border: solid 1px #af0e0e!important;background-color: #af0e0e!important;}
</style>
<!-- AdConsent configuration tag -->
<script>
  adconsent('setPublisherCC', 'AT');
  adconsent.gdpr('setPrivacyPolicy', '//www.mysite.com/privacyGDPR');
  adconsent.ccpa('setPrivacyPolicy', '//www.mysite.com/privacyCCPA');
  adconsent.gdpr('reconsiderConsent', 48);
  adconsent('start');
</script>

  • No labels