[Resolved] How can I modify some code lines for "Google Tag Manager" in the theme template?

Home Forums Support [Resolved] How can I modify some code lines for "Google Tag Manager" in the theme template?

Home Forums Support How can I modify some code lines for "Google Tag Manager" in the theme template?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #794096
    noe_sp

    How can I modify some code lines of “Google Tag Manager” in the theme template?

    so that every time I update the theme, do not have to modify it.

    Thanks in advance!

    #794162
    noe_sp

    Sorry! I have “generatepress_child” instalated

    #794189
    David
    Staff
    Customer Support

    Alternative to Child Theme templates is to use the GP Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    You can add the first GTM code to a WP_head hook and second code to the before_header hook.

    #794336
    noe_sp

    Many thanks David for this information,

    if I need to script for all pages I do it with the HOOKS?

    Thanks,

    #794338
    David
    Staff
    Customer Support

    Hooks are the easiest way to go, in the Hook Element > Display Rules you can select Entire Site. You can also Exclude the script for different posts / pages / templates and User Rules – such as User Role, so Admins don’t trigger events for example.

    #796333
    noe_sp

    Thank very much… David.

    the email platform does not detect the code.
    I created the element in 2 different ways:

    FIRST: Choose Element Type:
    as HEADER with “entire site”

    SECOND: Choose Element Type:
    as HOOK with “entire site”

    But don’t work you can help me for solve it…please.

    Many thanks in advance!

    #796390
    David
    Staff
    Customer Support

    They both need to be added to Hooks. So create a new hook for each of them, both will have the display rules for the entire site.

    First code – select Hook: wp_head
    Second code – select Hook: before_header

    #797745
    noe_sp

    Hi David…. It was solved…. Work very well!!!
    Was problem that email marketing platform.

    Many thinks
    Kind regards!

    #797812
    David
    Staff
    Customer Support

    Awesome – glad you got it resolved 🙂

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