Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7

Overview

WordPress is one of the most common commonly used content management systems for many publishers. AdEngine integration works with WordPress as seamlessly as with any other web page, however, there are some known issues, that can be avoided, due to the use of plugins. Following those simple guidelines will help with smooth implementation.

...

AdEngine implementation in WordPress should for best effect be done directly in page codes, for the best effectiveness. In Header the header and body, it's allowed to use plugins, hovwever however, please notice the possible issues listed below.

...

For this integration guide, we assume the example of a website with the following two ads on every page:

...

The head section modifications are the essential fundamental part of the integration. Without adding the AdEngine script and configuration to the head, the ads won't render.

...

If there are specific pages where only a subset of the ads are shown, it is important to declare the ad tags, that are used in the current page. If ad tags are not properly declared, ad units will be auctioned, even if not used. This will lead to false ad impressions, negatively affecting page performance and user experience.
You can declare ad units using the [snigelPubConf][snigelPubConf] element.

Please remember:

  • ad-unit-name: topleaderboard

  • div-name: adngin-topleaderboard-0

...

Code Block
<script data-cfasync="false" type="text/javascript">
  window.snigelPubConf = {
    "adengine": {
      "activeAdUnits": ["topleaderboard","sidebar"]
    }
  }
</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 the best possible performance

  • If [Google Analytics][googleAnalytics] 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 page body needs to define div elements which that will be filled with ads. They need to be placed where the ad should be displayed.
The div elements should reserve the maximum width and height of the displayed ad to prevent [Cumulative Layout Shift][cls] (CLS). If you are using ad labeling, reserve an additional 15px of height for the label. To reserve the proper space please consult your account manager to get the exact ad sizes.

...

Code Block
<div id="adngin-topleaderboard-0"></div>
<div id="adngin-sidebar-0"></div>COPYdiv>

Note:

  • If there are existing div elements that should be reused, provide the information to your account manager.

...

  1. Ensure that both codes for PubConfig snigelPubConf and loader.js have the elements:

    • data-cfasync="false"

    • async

  2. Do not place scripts from Snigel in minify and cache plugins, or if it can't be avoided place them in exclude from minify and cache section.

  3. Clear cache - both server and CDN to have a real overview if the implementation is corect correct and is not causing any issues. It's often when this step is missed an issue is visible only days or weeks after implementation.

...

  1. Minify plugins do a search on the page for all the content, then join all files - js JS and css CSS - without order , or dependencies, and mix before displaying it on the page. After that, they inject all the code and then compress the page. It impacts how several elements of the page work, especially the ad stack loader.

  2. Cache plugins - are caching old versions of scripts. When there is an a fix or an update, a new version doensdoesn't load, and fixes don't work.

  3. The typical issues:

    • Ads stop appearing,

    • CMP starts being called multiple times,

    • Scripts stop working completely,

    • Impact on A/B test run with different partners,

    • Use of data-cfasync="true" to minify scripts by cloudflare Cloudflare RocketLoader

    • Changes don't show due to old versions of the scripts being cached.

  4. Some of the typical plugins causing these sorts of issues: