Archived topic
Google Ads Tag Placement in Head Section of the Theme
3 replies · Started by Jatin on February 8, 2021
Hi Guys,
i want to place below tag in the head section to display the ads. However i do not want to edit the theme by going to theme editor -> header.php because when i will get the theme update i need to update the head section again i guess.
Please let me know if there are any alternative ways like hooks etc
<script data-ad-client="**********" async src="https://****************oogle.js"></script>
Hi there,
you can use a Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
The wp_head hook is the hook you require.
Thanks what should be the display rules for google adsense code which needs to be placed in head tag of the theme.
What about Execute shortcodes and Execute PHP checkboxes.
Use the Entire site for the display rules.
And you don't need to check to execute shortcodes or PHP.