Skip to content

Commit

Permalink
feat: add GTM container (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj authored Jul 11, 2024
1 parent 54cb455 commit 693ec30
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
33 changes: 33 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@
<meta name="twitter:title" content="{{ title }}" />
<meta name="twitter:description" content="{{ description }}" />
<meta name="twitter:image" content="{{ card_image }}" />

<!-- GTM Container -->
<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-P8H6KQG");
</script>
{% endblock %}

{% block announce %}
Expand All @@ -48,6 +65,22 @@
{% endblock %}


{% block scripts %}
{{ super() }}

<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-P8H6KQG"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->

{% endblock %}

{% block content %}
{% if page.edit_url %}
<a href="{{ page.edit_url }}" title="{{ lang.t('edit.link.title') }}" class="md-content__button md-icon">
Expand Down
3 changes: 0 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ extra:
link: https://www.youtube.com/madewithml?sub_confirmation=1
- icon: fontawesome/solid/paper-plane
link: mailto:[email protected]
analytics:
provider: google
property: G-T1R6V3J71R

# Page tree
nav:
Expand Down

0 comments on commit 693ec30

Please sign in to comment.