How to show ad only on specific categories

Posted in: Newspaper
Post count: 92

Hello,

Recently I received a mail from google adsense that it is not allowed to show adsense ad in the articles with tragedy/crimes etc (like news about terrorist attacks, robberies, plane crashes, car crashes etc.). So they told that it is necessary to restrict the google adsense ad from that kind of news. To do it, I need to remove adsense from some specific categories. Can you please advise if it is possible to do so?

An ideal way if I may replace adsense AD to some other type of AD on some particular category.

Thanks.

Post count: 23312

Hello mc_kot,

You can hide an Ad for a specific category only if you will use the category Id for that category, just like that -> http://screencast.com/t/Rsx9kbTSs Try to use this basic example for your website and let us know how it goes!

Thanks for the message!

Post count: 92

Hello,

Thank you for the reply

Do I assume correctly that after I put this code .category-35 .td-g-rec{display:none;} (adding the correct number of category ID off course) to custom CSS block https://gyazo.com/05213b1ad64ce3388c1eccdf0c3d4da5 all advertisement will disappear from that particular category? Is it possible to make disappear only some particular AD blocks but not all of them?

Thanks.

Post count: 6535

Hi

Yes you can use ad’s spot specific class for a more specific target, this is an example for sidebar ad:

.category-35 .td-a-rec-id-sidebar{
display:none;
}

You can use browser inspector to get the specific class for each ad-spot. For more details in this regard please check this link: https://forum.tagdiv.com/create-custom-code-using-the-browsers-inspector/
Hope this helps.
Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.