Last active
September 29, 2021 18:41
-
-
Save AbhishekGhosh/f6e03380bd7085b2903f429679a6b498 to your computer and use it in GitHub Desktop.
Ad Invalid Click Protector code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Install https://wordpress.org/plugins/ad-invalid-click-protector/ | |
<?php | |
if( aicp_can_see_ads() ) { | |
// This part will show ads to your non-banned visitors | |
$adCode = '<div class="aicp"> | |
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> | |
<!-- responsive_box --> | |
<ins class="adsbygoogle right-floating-ad" | |
style="display:block" | |
data-ad-client="ca-pub-8996933744651682" | |
data-ad-slot="5609641037" | |
data-ad-format="auto"></ins> | |
<script> | |
(adsbygoogle = window.adsbygoogle || []).push({}); | |
</script> | |
</div>'; | |
return $adCode; | |
} else { // show custom text/image like below | |
return '<div class="error">You have been blocked from seeing ads.</div>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment