[SOLVED] Google AdSense error: Only one AdSense head tag supported per page. The second tag is ignored.

Google AdSense have changed the codes for publisher ad-codes. The new code come in effect from 19th July 2021. They have suggested to change the old code with new for every ad-code. However it will continue work with old too. 

google-adsense-ad-code-error


ERROR

 N {message: "adsbygoogle.push() error: Only one AdSense head tag supported per page. The second tag is ignored.", name: "TagError", pbr: true, stack: "TagError: adsbygoogle.push() error: Only one AdSen…sbygoogle.js?client=ca-pub-XXXXXXXXXXXX:241:4"}


::  Error Source

1.     Mismatch in ad code format

 While changing the ad-codes we forgot to change the code of head tag <head></head> the error comes with the difference in ad-code format.



OLD CODE LOOKS


<script data-ad-client="ca-pub-XXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

NEW CODE LOOKS

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXX"     crossorigin="anonymous"></script>

 

2.    The repetition of below java link code in all ad code

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXX"     crossorigin="anonymous"></script>

 


::  Solutions

1.     Mismatch in ad code

Do change the old ad code with new ad code tag between 

<head></head>

2.    The repetition of below java link code in all ad code

As the java link code is copied by default from your AdSense page with every ad code. Remove it all and just keep the one in between 

<head>    </head>

Do not forgot to remove


the repeated java link code in body. Which is copied by default in every ad code. 

<body>       </body> 

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXX"     crossorigin="anonymous"></script>

::  Your code should looks in below format


Now your code looks like


<html>

<head>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXXX"     crossorigin="anonymous"></script>

</head>


<body>



<!-- square -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-XXXXXXXXXX"
     data-ad-slot="XXXXX"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>


</body>


</html>


SOLVED

message: "adsbygoogle.push() error: Only one AdSense head tag supported per page. The second tag is ignored." name: "TagError



Post a Comment

0 Comments