• Hi. I love this plugin, I’m having an issue with site speed.

    When I investigated I realised that the GTM code is always placed in the header. I’ve changed the “Container code placement” setting and it’s still the same. If I select “Custom (needs tweak in your template)” the JS GTM continues to appear, but the No JS version disappears. In short it looks like the setting is only moving the <noscript> code.

    Is that correct?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Yes, this is correct as the container in the head has to be in the head regardless of the placement option you set. I will try to clarify this in the next plugin version on the options page.

    Have a great day,
    Thomas

    Thread Starter hatched

    (@hatched)

    Hi Thomas

    Thank you for the update. I didn’t expect that. Do you mind explaining what’s the purpose of the “Container code placement” variable?

    Sorry, thats lost on me.

    Donal

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi Donal,

    The code placement decides where to put the so called noscript part of the GTM container code. It is only executed in browsers where JavaScript is either not available or disabled for some reason thus it should affect only a few users on most websites.

    Officially it should be put after the opening body tag but WordPress does not have any official support it its theme system to do so therefore some tweaks has to be made. If this does not work, select the “footer” option and use the time for some more important tasks 🙂 It will work anyway.

    Thomas

    Hi,

    what do i need to choose from the Container code placement options?

    Footer of the page (not recommended by Google, no tweak in your template required)
    Custom (needs tweak in your template)
    Codeless injection (no tweak, right placement but experimental, could break your frontend)
    Off (only add data layer to the page source)

    Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi eli23,

    Next time, please post a new question instead of replying to an existing thread. Thanks!

    Try to start with codeless, if this does not break the design of your frontend, you can keep it. If it does, try the custom option that needs an additional line in your header*.php files.

    If you feel uncomfortable with editing PHP codes, footer option will be sufficient.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Container code placement Not Working’ is closed to new replies.