So I have got one hater in India who bombarded on my adsense ad units. Luckily I didn't get banned from Google. I have blocked Indian visitors from my site using iq-blockcountry plugin (wordpress). Now I want to know if there's any procedure so that I can allow the Indian visitors but hide the adsense units from them? I don't want to block all visitors just because of one foolish person.
|
Good way to do this is - switching from AdSense to DFP Small Business. You can display AdSense with DFP and apply Geo-targeting feature.
(I do not know Sam Azgor, but that looks to me like very fine step-by-step explanation.) That needs some time and effort and that is a good way. Now, the bad way - quick an risky: you can try some hacking in file iq-block-country.php, line 351:
You may try this, instead:
And, in your template - just print them:
Example above is also a good example of bad coding (downvoting would not be surprise here), but it is an answer, I believe. Very important: if you go with "bad way" - prepare your backups. If something goes wrong, I can not help you. Consider that as a pseudocode, and if works - as a temporary solution, and ask "iq-blockcountry" developers to implement "AdSense feature". |
||||
|
|
|
You could conditionally hide the ad block with some geolocation service. However you cannot be 100% sure that you are going to block all IPs from India. |
|||
|
|