Adsense wrapper

Posted in: Newspaper
Post count: 39

Hi,

We have partnered with ezoic for Google Adsense and they ask to wrap the AdSense code with DIV elements

<!– Ezoic – Header add – top_of_page –>
<div id=”ezoic-pub-ad-placeholder-107″></div>
<!– End Ezoic – Header add – top_of_page –>

Code has been added in the theme panel, please check

https://ibb.co/gSGRAk

But not getting reflected.

https://ibb.co/bJwF35

Please check and advise.

Post count: 39

Hi,

We need to do the same with all the ads appearing in Header, Article inline, Article bottom, Post template style 12,13, custom add 1 & 2.

Please check and advise soon.

Post count: 20688

Hi,

Try entering the code directly in the theme file where the ad is created. Like in this example
https://www.screencast.com/t/XcByaufiM
https://www.screencast.com/t/fq3AHlWwfzC
It should look like this – https://www.screencast.com/t/ii5FCgOxfqP
Or maybe you can find another way using this solution, or find it helpful in some way.

Thanks

Post count: 39

Hi,

We need to wrap all the ad units like this Headerad,Article Inline ad,Article Footer ad, Post template 12,13, Custom add1,Custom add1 please guide us by pointing to the theme file, we were unable to locate the files.

Post count: 20688

Hi,

The file where you need to try and make these modifications is the td_block_ad_box.php located in the theme files – Newspaper\includes\shortcodes\td_block_ad_box.php
https://www.screencast.com/t/beGn9uZua
There you can wrap the script in the code you want, and it should be present anywhere an Adsense ad is displayed.

Thanks

Post count: 39

Hi,

I’m having a separate wrapper code for each and every addunit(Headerad,Article Inline ad,Article Footer ad, Post template 12,13, Custom add1,Custom add1). How it will work?

Post count: 20688

Hi,

I forgot about that possibility, I am very sorry. After further testing with wrapping the ad code with the code you provided it seems to work properly just by entering it normally
https://www.screencast.com/t/vRluSJKG0
https://www.screencast.com/t/pY1jHiYNauo
Maybe this is just a misunderstanding, I am sorry for not thinking that you might need to use a different code for each of your ads. Try wrapping the ad script normally and inspect the page, the code should be there.

Thanks

Post count: 39

Hi,

We have tried that before and it doesn’t work, so that only we have created the ticket.

Screenshots enclosed.

Header
Inline

https://ibb.co/f3F1RQ
https://ibb.co/g7bQmQ

Please inspect the pages and check.

Post count: 20688

Hi,

After further investigations it seems the theme ignores any other content present in the ad section, besides the Adsense script code. Since you need different codes for each section the method I suggested is not useful. Another way would be to make modifications to the way the theme renders the Adsense ads, but that could not be so easy. What I suggest is to find an Adsense plugin that has a different ad implementation and will display the needed code. Please consider this option and try implementing the ads through an ad plugin, for this case.

Thanks

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