Reputation: 409
I built a WordPress site (Newspaper template) and wanted to add Google AdSense. After approval I added the code, but it gives me the error listed below:
Uncaught M {message: "adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page.", name: "TagError", pbr: true, stack: "TagError: adsbygoogle.push() error: Only one 'enab…syndication.com/pagead/js/adsbygoogle.js:1:21800)"} message: "adsbygoogle.push() error: Only one 'enable_page_level_ads' allowed per page."
I have no idea what to do. Does anybody have any idea?
Upvotes: 1
Views: 3008
Reputation: 11
Check your website's page source for multiple AdSense code. Use Ctrl+U (or view-source:website.com), Ctrl+F and search for pub-.
If you are using WordPress you might have two code
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-****************",
enable_page_level_ads: true,
tag_partner: "site_kit"
});
</script>
<script data-ad-client="ca-pub-****************" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Removing one of these code to resolve this issue.
Upvotes: 1
Reputation: 406
hmm.. maybe script code that Google Adsense had provided was written down two or more on your website.
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "your client id",
enable_page_level_ads: true
});
</script>
check this script if it was duplicated. If you clear the duplicate, the error will disappear.
Have a nice day :D
Upvotes: 3