Anchor Ads
By default, Ezoic will show anchor ads if enabled in the dashboard under the Ezoic Ads tab.
Turning Off Anchor Ads
To turn the Anchor Ad off for a specific page, the ezstandalone.setEzoicAnchorAd
function can be used.
In order for this functionality to work, it must be called prior to
ezstandalone.enable()
.
1<script >
2 window.ezstandalone = window.ezstandalone || {};
3 ezstandalone.cmd = ezstandalone.cmd || [];
4 ezstandalone.cmd.push(function() {
5 ezstandalone.setEzoicAnchorAd(false);
6 ezstandalone.showAds(101, 102, 103);
7 });
8</script>
Checking If Anchor Ad Was Closed
To see if the Anchor Ad has been closed for a user's session, use the hasAnchorAdBeenClosed
function.
Below is an example of using the function to determine whether to keep showing the Anchor Ad
1<script >
2 window.ezstandalone = window.ezstandalone || {};
3 ezstandalone.cmd = ezstandalone.cmd || [];
4 ezstandalone.cmd.push(function() {
5 let anchorHasBeenClosed = ezstandalone.hasAnchorAdBeenClosed();
6 ezstandalone.setEzoicAnchorAd(anchorHasBeenClosed);
7 ezstandalone.showAds(101, 102, 103);
8 });
9</script>