Site logo

Archived topic

Cant add adsense code between the < Head>and tags

2 replies · Started by Alex on November 21, 2017

Viewing posts 1–3 of 3

When i go to Appearance > editor > select theme header (header.php)

i copy and paste this after the <head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
google_ad_client: "ca-pub-xxxxxxxxxxx",
enable_page_level_ads: true
});
</script>

i get an error and it wont update.

Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.

i added the code into the wp_head hook in GP Hooks

Glad you figured out!

This archived topic is closed to new replies.