• Resolved N33D

    (@n33d)


    Hi there,

    It seems the GTM tag is only added in the body (before the closing body tag). Though why is Complianz not adding also the head tag of GTM?

    Thanks in advance.
    Looking forward to your reply.
    Justin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @n33d,

    If you mean if we add the ‘main’ tag near the footer, and do not add the <noscript> tag, then this is correct.

    The <noscript> tag loads GTM when Javascript is not available, and if javascript is not available, Complianz won’t work correctly as would most themes, and plugins.

    You can add it yourself, if so desired, but the very small percentage of extra data is skewed due to a website that is affected by severe javascript errors, or disabled all together.

    Let me know if you have any questions, regards Aert

    Thread Starter N33D

    (@n33d)

    Hi @aahulsebos ,

    Thanks for your reply and sounds understandable.

    Can you explain why Complianz choose to add the <script> tag near the footer of the website instead of in de <head> tag like Google suggests like in this article: https://support.google.com/optimize/answer/6315850?

    Thanks in advance!
    Justin

    Plugin Contributor Aert Hulsebos

    (@aahulsebos)

    Hi @n33d,

    I think this is the best, general solution to allow for performance and accuracy at the same time for the broadest user base.

    It’s a matter of preference, the amount of tags in your GTM container, if it’s essential among other javascript in your <head>, if you need data or functionality from GTM when the <body> is loading, but not interactive. You could be loading custom events, like scroll or click events, while the page is neither scrollable or the buttons have not yet appeared. In that case delaying the container slightly, should bring a slight performance boost and no effect toward your analytics.

    For new users, tags are only released on consent status that are loaded after interacting with the banner, which is after page load. The rest is of course cached, but it’s a personal preference in the end.

    If you select the 3 checkboxes under Statistics in the wizard, you get a question in the next screen if Complianz needs to add the script. You can say no, and do it yourself if so desired, regards Aert

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘GTM Tag only added in body, not head?’ is closed to new replies.