Support > Publisher > Show adverts when event is triggered (not onload)

Show adverts when event is triggered (not onload) (#2108)

(Last Update: 12.05.2016)

Our ad script ensures that adverts are not loaded until users actually see them in the viewport of their browser (Actual Impression). You can use this mechanism to load adverts only when an event is triggered, e.g. after a user input. Just hide the appropriate container and make it appear as soon as it is needed.


Code-Example


<button onclick="document.getElementById('My_Solads_Advert').style.display='block'">Load advert now...</button>
<div id="Meine_Solads_Anzeigen" style="display:none">
<script type="text/javascript">
m3ads_system="Solads";
m3ads_partnernumber=1234;
m3ads_sectors="2016";
m3ads_numberadverts=1;
m3ads_imagewidth=300;
m3ads_imageheight=250;
</script>
<script type="text/javascript" src="//cdn.feed.solads.media/resources/scripts/jsAds-1.4.min.js"></script>
</div>