Hi,
Inside PHP it is even easier to call. Here is an example
<?php
// lets say this is a template page
// or whatever page, doesn't matter
// you can directly do this:
if( aicp_can_see_ads() ) {
// show ads to the users who are allowed to see
$adCode = '<div class="aicp"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><!-- 300x250 Example Ad Code -->
<ins class="adsbygoogle"
style="display:inline-block;width:300px;height:250px"
data-ad-client="ca-pub-1234567890123456"
data-ad-slot="987654321123"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>';
echo $adCode;
} else {
// This segment is optional
// Show anything for users who are banned from seeing ads
echo '<div class="ad-banned">You cannot see anymore ads. Sorry!</div>';
}
?>
I hope this helps.