[Resolved] Setting up Google Tag Manager Data Layer in GeneratePress

Home Forums Support Setting up Google Tag Manager Data Layer in GeneratePress

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #1002516

    Dear Support Forum,

    We have implemented Google Tag Manger using this excellent guide and it works very well:

    We would now like to add ‘Data Layers’ in Google Tag Manager and we are following this guide:

    Our question is: How do we implement it in GeneratePress?

    We presume by creating a new Hook Element with the following settings:

    – Content > this is where we paste the code from the guide

    – Settings > Hook > ??? -> which hook is best ? According to the link, it should go should go in the WordPress header of the child theme but before Google Tag Manager container snippet

    – Settings > Priority > ??? -> should the priority be zero?

    – Display Rule > Location > Entire Site

    – any other settings, e.g. ‘execute php’ ?

    Many thanks for your help on this.

    Kind regards,

    Pairfum London

    Customer Support

    Hi there,

    Looks like it should go in wp_head as well.

    Since it needs to go before GTM, you can set the GTM code to priority 5 and this one to priority 2.

    Setting it to the entire site should be good and also execute PHP.

    Let me know πŸ™‚


    Hi Leo,

    Many thanks for your quick response & advice.

    Your tip about setting the priority is very good:
    – 2 for the Data Layer hook, and
    – 5 for the main GTM container.

    I had been wondering how to fire it before the main GTM container in wp_head.

    ‘Entire site’ has been set and ‘execute php’ ticked.

    Again, many thanks for your help.

    Kind regards,

    Pairfum London

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