Skip to content
New issue

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

fix: add google tag manager script #993

Merged
merged 5 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/_includes/layouts/default.njk
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
{% block monetization %}
{% endblock %}

{% include "partials/gtm-head.njk" %}
ahmaxed marked this conversation as resolved.
Show resolved Hide resolved

{# Dynamically load MathJax script #}
{% block mathjax %}
{% endblock %}
Expand Down Expand Up @@ -133,6 +135,9 @@
{% else %}
<body class="home-template">
{% endif %}

{% include "partials/gtm-body.njk" %}
ahmaxed marked this conversation as resolved.
Show resolved Hide resolved

<div class="site-wrapper">
{% include "partials/site-nav.njk" %}

Expand Down
4 changes: 4 additions & 0 deletions src/_includes/partials/gtm-body.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5D6RKKP"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>


ahmaxed marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions src/_includes/partials/gtm-head.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<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-5D6RKKP');</script>
Loading