Title: Question for setup
Last modified: January 17, 2017

---

# Question for setup

 *  Resolved [ivan126](https://wordpress.org/support/users/ivan126/)
 * (@ivan126)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/question-for-setup/)
 * 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](https://wordpress.org/support/users/ivan126/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/question-for-setup/#post-8663165)
 * 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.

 * ![](https://ps.w.org/ad-invalid-click-protector/assets/icon-256x256.png?rev=1534940)
 * [Ad Invalid Click Protector (AICP)](https://wordpress.org/plugins/ad-invalid-click-protector/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ad-invalid-click-protector/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ad-invalid-click-protector/)
 * [Active Topics](https://wordpress.org/support/plugin/ad-invalid-click-protector/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ad-invalid-click-protector/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ad-invalid-click-protector/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [iSaumya](https://wordpress.org/support/users/isaumya/)
 * Last activity: [9 years, 4 months ago](https://wordpress.org/support/topic/question-for-setup/#post-8663165)
 * Status: resolved