[Resolved] Google Ads Tag Placement in Head Section of the Theme

Home Forums Support [Resolved] Google Ads Tag Placement in Head Section of the Theme

Home Forums Support Google Ads Tag Placement in Head Section of the Theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1650438
    Jatin

    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&gt;

    #1650482
    David
    Staff
    Customer Support

    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.

    #1650975
    Jatin

    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.

    #1650976
    Leo
    Staff
    Customer Support

    Use the Entire site for the display rules.

    And you don’t need to check to execute shortcodes or PHP.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.