• Resolved ivan126

    (@ivan126)


    Hello I am having trouble to understand how to setup the plugin. This part I do not understand:

    Put a if( aicp_can_see_ads() ) { /* return your ad code here */ } block before returning your ad code to the front end
    Wrap your ad code within a simple div tag like this <div class=”aicp”>…your ad code goes here…</div>

    Can you show on example adsense code not real one how to put these ? Also modifying adsense code is against their TOS, or we are not modifying it ?

    And a final question. What about caching plugins ? How do we need to setup them in order for the plugin to work. I hope I do not have to disable it completely as my site speed will suffer.

    Thanks in advance.

    • This topic was modified 9 years, 4 months ago by ivan126.
Viewing 1 replies (of 1 total)
  • Plugin Author iSaumya

    (@isaumya)

    Hi there,
    Let me answer your questions cronologically:

    Put a if( aicp_can_see_ads() ) { /* return your ad code here */ } block before returning your ad code to the front end
    Wrap your ad code within a simple div tag like this <div class=”aicp”>…your ad code goes here…</div>

    – An example code is already given in the description section of the plugin and also shown in the video demonstration. So, I’m copy pasing the example shortcode creation code given in the descripsion below:

    add_shortcode( 'your_shortcode_name', 'your_shortcode_function_name' );
    function your_shortcode_function_name() {
        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 -->
            <!-- Your AdSense Code Starts Here -->
            <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
            <!-- AdSense Responsive Ad Code -->
            <ins class="adsbygoogle"
                 style="display:block"
                 data-ad-client="ca-pub-1234567890"
                 data-ad-slot="0987654321"
                 data-ad-format="auto"></ins>
            <script>
            (adsbygoogle = window.adsbygoogle || []).push({});
            </script>
            <!-- Your AdSense Code Ends here -->
            </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>';
        }
    }

    Also modifying adsense code is against their TOS, or we are not modifying it ?

    – We are not modifying the adsense code anyway, as youcan see above you just need to copy paste your adsense code above. No need to modify your adsense code.

    What about caching plugins ? How do we need to setup them in order for the plugin to work.

    – I have tested the plugin with various cache plugin like cache enabler, wp rocket, super cache etc. and there is no problem whatsoever. You just have to make sure that after you setup the plugin and it’s code, you clear your full cache so that the updated codes can reflect in your site. That’s it.

    Hope this helps. 🙂

Viewing 1 replies (of 1 total)

The topic ‘Question for setup’ is closed to new replies.