[Support request] Google Tag manager code insertion breaks frontend header/menu

Home Forums Support Google Tag manager code insertion breaks frontend header/menu

  • This topic has 6 replies, 3 voices, and was last updated 7 months ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1038071
    Morten

    Hey! I’ve added two hooks to my side:

    The main google tag manager code in the WP_head.

    And the fallback code in before_header with priority 0.

    But when i do, my frontend menu/navigation breaks. The main navigation jumps down below the logo, and the sticky menu disappears completely. Is this a known thing, and what can i do to get out of it? I’d prefer not to add any code manually, and i have no php knowledge.

    I’ve disabled the hooks for now, as our site can’t run with them enabled, obviously 😛

    #1038079
    David
    Staff
    Customer Support

    Hi there,

    instead of the before_header hook select Custom Hook and add: wp_body_open

    This will be included in the Hook list in the next update.

    #1038108
    Morten

    Hi David,

    I just did that, breaks my site in the same way as before.

    #1038114
    Morten

    Hi again David,

    Could it be something as simple as removing the (i guess obsolete)

    <!– Google Tag Manager –>
    <!– End Google Tag Manager —>

    from the code snippet? Or will that break the google code instead?

    I think that worked, still testing.

    #1038249
    David
    Staff
    Customer Support

    Can you share the exact code you’re adding to the Hooks ?

    When adding code in the forum, please highlight the code and hit the Code button.

    #1168852
    Manuel

    Same problem here. The menu in frontend disappear after inserting the Google Tag Manager code as mentioned here: https://docs.generatepress.com/article/implement-google-tag-manager/

    How did you solved this?

    #1168877
    David
    Staff
    Customer Support

    Hi there,

    if you want to start a new topic where you can share a link to your site with the ‘broken’ code in place and i can take a look at what the issue is.

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