Hi @sofianorway,
The code has already been shared in the plugin description. Please read the plugin description. Everything is mentioned there along with example code.
I do put it as it is but it does show extra writing along the AdSense code… What am i doing wrong?
Please share the code that you have added. You have definitely made some mistakes. Without looking at the code you have added, hard to say anything.
Hi this is what I did….
add_shortcode( ‘your_shortcode_name’, function() {
if( aicp_can_see_ads() ) { // This part will show ads to your non-banned visitors
$adCode = ‘<div class=”aicp”><!– Don\’t forget to add this div with aicp class –>
<script async src=”https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– before post recipasta –>
<ins class=”adsbygoogle”
style=”display:block”
data-ad-client=”ca-pub-5558553902964468″
data-ad-slot=”4710020210″
data-ad-format=”auto”
data-full-width-responsive=”true”>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div><!– end of the aicp div –>’;
return $adCode;
} else { // Anything within this part will be shown to your banned visitors or to the blocked country visitors
return ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
}
} );
Can you share a screenshot of what it is showing in the frontend?
i can’t work out how to post screenshot …
Hi @sofianorway,
Please Google and Youtube about it. As without looking at the problem I cannot diagnose it in any way.
The code shows me on my website the actual adslvwrtisent and some writing from the code like the message :
add_shortcode( ‘your_shortcode_name’, function() {
if( aicp_can_see_ads() ) { // This part will show ads to your non-banned visitors
< The actual advertisement works here >
return ‘<div class=”error”>You have been blocked from seeing ads.</div>’;
do you have any app that i can send you my screenshot please ??