Publisher Mode Demo: chinahandys

This page contains the complete ad configuration


🔧 Integration

This code should be placed in the head of your page


<link rel="preconnect" href="https://securepubads.g.doubleclick.net" crossorigin="anonymous">
<link rel="preconnect" href="[[domain]]" crossorigin="anonymous">
<!-- sourcepoint CMP (required) -->
<script>
  !function () { var e = function () { var e, t = "__tcfapiLocator", a = [], n = window; for (; n;) { try { if (n.frames[t]) { e = n; break } } catch (e) { } if (n === window.top) break; n = n.parent } e || (!function e() { var a = n.document, r = !!n.frames[t]; if (!r) if (a.body) { var i = a.createElement("iframe"); i.style.cssText = "display:none", i.name = t, a.body.appendChild(i) } else setTimeout(e, 5); return !r }(), n.__tcfapi = function () { for (var e, t = arguments.length, n = new Array(t), r = 0; r < t; r++)n[r] = arguments[r]; if (!n.length) return a; if ("setGdprApplies" === n[0]) n.length > 3 && 2 === parseInt(n[1], 10) && "boolean" == typeof n[3] && (e = n[3], "function" == typeof n[2] && n[2]("set", !0)); else if ("ping" === n[0]) { var i = { gdprApplies: e, cmpLoaded: !1, cmpStatus: "stub" }; "function" == typeof n[2] && n[2](i) } else a.push(n) }, n.addEventListener("message", (function (e) { var t = "string" == typeof e.data, a = {}; try { a = t ? JSON.parse(e.data) : e.data } catch (e) { } var n = a.__tcfapiCall; n && window.__tcfapi(n.command, n.version, (function (a, r) { var i = { __tcfapiReturn: { returnValue: a, success: r, callId: n.callId } }; t && (i = JSON.stringify(i)), e.source.postMessage(i, "*") }), n.parameter) }), !1)) }; "undefined" != typeof module ? module.exports = e : e() }();
</script>
<script>
window._sp_ = {
    config: {
        accountId: 270,
        baseEndpoint: 'https://cdn.privacy-mgmt.com'
    }
}
</script>
<script async src="https://cdn.privacy-mgmt.com/wrapperMessagingWithoutDetection.js"></script>

<!-- your ad tag -->
<script async="async" src="[[domain]]moli_b0301cb53b33c7f8cbef.js"></script>

This ad tag is in publisher mode, which means you can control when the ads are being loaded. Add this code anywhere on your page / javascript.

 // initialize the command queue
window.moli = window.moli || {que: []};
window.moli.que.push(function (moliAdTag) {
    // configure your ad tag
    // see section "just
    // trigger ads
    moliAdTag.requestAds();
});
            

JustPremium and ScreenOnDemand

enable on content-01 enable on content-02

 // initialize the command queue
window.moli = window.moli || {que: []};
window.moli.que.push(function (moliAdTag) {
    if (showOnContent01) {
       moliAdTag.addLabel('justpremium-content-01');
       moliAdTag.addLabel('dspx-content-01');
    } else if (showOnContent02) {
       moliAdTag.addLabel('justpremium-content-02');
       moliAdTag.addLabel('dspx-content-02');
    }

    // trigger ads
    moliAdTag.requestAds();
});
            

Mobile Sticky Ad

Here is a minimal code example that we use on this example page for the mobile sticky ad with a close button.

html
<div id="ad-mobile-sticky-container">
    <div id="ch-ad-mobile-footer"></div>
    <button class="ad-mobile-sticky-close" id="ad-mobile-sticky-close"></button>
</div>
css
#ad-mobile-sticky-container {
    position: fixed;
    width: 100%;
    background: #f2f0ed;
    bottom: 0;
    text-align: center;
    z-index: 5;
    box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.2);

    @media (min-width: 768px) {
        display: none;
    }
}

#ch-ad-mobile-footer {
    text-align: center;
}

.ad-mobile-sticky-close {
    background-color: #f2f0ed;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='13' height='13' viewBox='341 8 13 13' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%234F4F4F' d='M354 9.31L352.69 8l-5.19 5.19L342.31 8 341 9.31l5.19 5.19-5.19 5.19 1.31 1.31 5.19-5.19 5.19 5.19 1.31-1.31-5.19-5.19z' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-position: 9px;
    background-repeat: no-repeat;
    background-size: 13px 13px;
    border: none;
    border-top-left-radius: 12px;
    box-shadow: 0 -1px 1px 0 rgba(0, 0, 0, 0.2);
    height: 28px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: -28px;
    width: 28px;

    &::before {
         bottom: 0;
         content: "";
         left: -20px;
         position: absolute;
         right: 0;
         top: -20px;
     }
}
js
<script>
    adStickyContainer = window.document.getElementById('ad-mobile-sticky-container');
    adStickyCloseButtion = window.document.getElementById('ad-mobile-sticky-close');
    adStickyCloseButtion.addEventListener('click',() => adStickyContainer.style.display = 'none');
</script>

🧾 Sourcepoint CMP

Basic setup documentation

Footer link for the privacy modal

TCF 2 and german law require the privacy settings to be accessible at all times. A clean way to do this is to add a link into the footer that opens the privacy manager.

Privacy Settings

<a href="#" onclick="window._sp_.loadPrivacyManagerModal(176542);">Privatsphäre></a> 

Privacy Page

Additionally to sourcepoint scripts integrated in the head of your page, place this button on your privacy page to open the privacy manager

<button type="button" onclick="window._sp_.loadPrivacyManagerModal(176542);">Datenschutz Einstellungen öffnen></button>

🔮 Moli Console

You can get more details by opening the moli console.

enable ad tag console logs enable prebid console logs enable test mode

Or if you are developer type this into the javascript console

moli.openConsole()

Ad Slots

ch-ad-outer-right (ch_sidebar_right)


ch-ad-outer-left-sticky (ch_sidebar_left_sticky)


ch-ad-outer-right-sticky (ch_sidebar_right_sticky)


ch-ad-sidebar-prices (ch_marginal_2_sticky)


ch-ad-sidebar (ch_marginal_1)


ch-ad-billboard (ch_header)


ch-ad-content-01 (ch_content1)


ch-ad-content-02 (ch_content2)


ch-ad-content-03 (ch_content3)


ch-ad-content-04 (ch_content4)


ch-ad-content-05 (ch_content5)


ch-ad-comments-01 (ch_comments1)


ch-ad-comments-02 (ch_comments2)


ch-ad-mobile-footer (ch_mobile_stickyad)