Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create the following tag in the <head> element of the page:

Code Block
languagenone
<script data-cfasync="false" async src="https://cdn.snigelweb.com/adengine/**site.domain**/loader.js" type="text/javascript"></script>COPYscript>

Note:

  • Replace **site.domain** with the actual site domain

  • Place the script at the very top of the header to ensure the best performance

  • If Google Analytics is used, place the AdEngine tag after the Google Analytics tag

...

The following example assumes that a page only has the Top Leaderboard and no Sidebar_2 through AdEngine. Create the following tags in the element of the page:

Code Block
languagenone
<script data-cfasync="false" type="text/javascript">
  window.snigelPubConf = {
    "adengine": {
      "activeAdUnits": ["topleaderboard","sidebar_2"]
    }
  }
</script>
<script data-cfasync="false" async src="https://cdn.snigelweb.com/adengine/**site.domain**/loader.js" type="text/javascript"></script>COPYscript>

Note:

  • Replace **site.domain** with the actual site domain

  • Place the script at the very top of the header to ensure best performance

  • If Google Analytics is used, place the AdEngine tag after the Google Analytics tag

  • Keep the correct order of the tags: first configuration and then loading of AdEngine

...

The following example assumes that a page fills a Top Leaderboard and Sidebar_2 through Snigel and a Sidebar through GPT. Create the following tags in the <head> element of the page:

Code Block
languagenone
<script data-cfasync="false" type="text/javascript">
  // define ad-slot using googletag defineSlot
  window.googletag = window.googletag || { cmd: [] };
  googletag.cmd.push(function() {
    googletag.defineSlot("/1234567/sidebar", [160, 600], "div-sidebar").
      addService(googletag.pubads());
  });
</script>
<script data-cfasync="false" type="text/javascript">
  window.snigelPubConf = {
    "adengine": {
      "activeAdUnits": ["topleaderboard","sidebar_2"],
      "additionalGptAdSlotIds": ["div-sidebar"]
    }
  }
</script>
<script data-cfasync="false" async src="https://cdn.snigelweb.com/adengine/**site.domain**/loader.js" type="text/javascript"></script>

...

AdSense ad-units need to be declared following the Google implementation guide.
Please remove this part of code from your page, as it will be delivered automatically by AdEngine.

Code Block
languagenone
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Only this declaration of code is needed:

Code Block
languagenone
<!-- AdEngine Top Leaderboard -->
<div id="adngin-topleaderboard-0"></div>

<!-- AdSense Sidebar -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

...

When dealing with automatic AdSense, and there are no div elements being set, it's required to keep the initialization code but it needs to be paused when used in conjunction of our AdConsent. AdEngine will unpause AdSense again as soon as the consent is provided.

Code Block
languagenone
<!-- load adSense -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1234567891234567"></script>
<script>
  // globally pause AdSense delivery
  (adsbygoogle=window.adsbygoogle||[]).pauseAdRequests=1;
</script>

...

It is recommended to test an AdEngine integration on a staging page first to prevent any problems , and allow your account manager to review the integration before going live on production.

⚠️ If you apply all steps directly on the live page without a review from your account manager, Snigel can`t be held responsible for any revenue loss.

On the staging page, use the staging version of AdEngine, which is accessible on staging-cdn.snigelweb.com instead of the production version available at cdn.snigelweb.com.

Code Block
<script data-cfasync="false" async src="https://staging-cdn.snigelweb.com/adengine/**site.domain**/loader.js" type="text/javascript"></script>

...

.

Consent management

If you are using AdConsent to manage user consent, there are additional elements required to be compliant with privacy laws.

...