AdSense ad shows above header

Posted in: Newspaper
Post count: 75

Hi,
I have added the Google AdSence code in header.php file like this:

<head>
  <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-9215968XXXXXXXXX",
    enable_page_level_ads: true
  });
</script>
    <title><?php wp_title('|', true, 'right'); ?></title>
    <meta charset="<?php bloginfo( 'charset' );?>" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    <?php
    wp_head(); /** we hook up in wp_booster @see td_wp_booster_functions::hook_wp_head */
    ?>
</head>

The problem is that ads show up over or in THE header above top bar.
Here is a screenshot.

How can I remove it?
Thank you in advance.

  • This topic was modified 8 years by lazdim.
  • This topic was modified 8 years by lazdim.
Post count: 20688

Hi,

Indeed the Google Adsense verification code has to be entered between the head tags in the header.php file
https://www.screencast.com/t/2noeCTl9Z
Then the actual ad code has to be entered in the Theme panel->Ads section in the location you want
https://forum.tagdiv.com/ads-adsense-overview/
If there is a problem, please provide a link to your website so we can inspect the issue.

Thanks

Post count: 75

Hi Simion,
Actually, we have created 3 custom ads for AdSense with auto dimensions in the home page.
These positions should be able to accept any AdSense ad banner from other websites so they are empty, no code in them.
Indeed, it works just fine but we want to remove the position above the top bar.

To be honest, we are not sure how we can do that, meaning what kind of ad code to ebter in the ads positions so we would be grateful if you could inspect our website.

Thank you in advance.

Post count: 20688

You seem to be using Google auto placed ads, these cannot be controlled. These ads will be displayed randomly in the website. You will have to use ads with defined placement. More information here
https://support.google.com/adsense/answer/160534?hl=en

Thanks

Post count: 75

Hi Simion,
We think this is not what we exactly need.
What if, instead of placing the code in head section, we paste it to each location an ad we want to appear through Theme Panel?

Post count: 20688

Enter the provided Adsense ad code in the theme panel section you want and it will be displayed.

If you also have a verification code that you must enter between the <head> tags enter it as mentioned above in the header file. That would be all, no other action necessary.

I have seen other users which have used Google auto placed ads instead of standard ads, these will appear randomly in the page
https://productforums.google.com/forum/#!topic/adsense/dQgnENvdyYY

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