Archived topic
AdSense code
7 replies · Started by Brad on September 7, 2021
I am trying to insert the AdSense code into my header on my website but it does not want to show up for some reason.
I use the hook header element with zero luck. I am curious why it might not be adding it properly?
website link
Hi there,
Try using a hook element:
https://docs.generatepress.com/article/hooks-element-overview/
And select wp_head as the hook name.
Make sure your caching plugins are clear after that.
I purged the cache on my plugin and on my hosting server. Can you verify if the code is there as I don't know how to actually check if its there. I used a hook element with those settings as well.
It doesn't show up. I checked it just now. Not sure why.
What is the code you are trying to add?
Can you paste it here?
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5597661240380942"
crossorigin="anonymous"></script>t>
That's the code
Hi Brad,
On the Hook element you've placed this code on, did you assign a display rule location? It's needed for the Hook Element to work properly.
Can you check and confirm? Let us know. :D