We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable a way to include Google Tag Manager without having to hack default.html.
Right now you need to:
--- --- <!doctype html> {% include copyright.html %} <html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js"> <head> {% if jekyll.environment == 'production' %} {% comment %} <script async src="https://www.googleoptimize.com/optimize.js?id=OPT-T4ZK4CX"></script> {% endcomment %} <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-XXX');</script> <!-- End Google Tag Manager --> {% endif %} {% include head.html %} {% include head/custom.html %} </head> <body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}"> {% if jekyll.environment == 'production' %} <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> {% endif %} {% include_cached skip-links.html %} {% include_cached masthead.html %} <div class="initial-content"> {{ content }} {% include after-content.html %} </div> {% if site.search == true %} <div class="search-content"> {% include_cached search/search_form.html %} </div> {% endif %} <div id="footer" class="page__footer"> <footer> {% include footer/custom.html %} {% include_cached footer.html %} </footer> </div> {% include scripts.html %} </body> </html>
Would be nice to be able to add Tag Manager without having to modify default.html, if possible.
See above example.
The text was updated successfully, but these errors were encountered:
There's {% include head/custom.html %} so you can always override that file instead of default.html.
{% include head/custom.html %}
default.html
Sorry, something went wrong.
Except that some of the content needs to be placed just below the body-tag.
You can override skip-links.html if you want. I'm not a fan of <noscript> in 2024.
skip-links.html
<noscript>
No branches or pull requests
What happened?
Expected behavior
Enable a way to include Google Tag Manager without having to hack default.html.
Right now you need to:
Would be nice to be able to add Tag Manager without having to modify default.html, if possible.
Steps to reproduce the behavior
See above example.
Other
See above example.
The text was updated successfully, but these errors were encountered: