Skip to content

Commit 2229693

Browse files
committed
[docs] DM-5427 Google Tag Manager setup for analytics in our docs
1 parent e2dd30b commit 2229693

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ docs_dir: src
1414

1515
theme:
1616
name: material
17+
custom_dir: overrides
1718
logo: images/amper-icon.svg
1819
favicon: images/amper-icon.svg
1920
icon:
@@ -103,6 +104,7 @@ markdown_extensions:
103104
watch:
104105
- .icons
105106
- includes
107+
- overrides
106108

107109
nav:
108110
- 'Home': index.md

docs/overrides/main.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "base.html" %}
2+
3+
{% block analytics %}
4+
<!-- Google Tag Manager -->
5+
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
6+
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
7+
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
8+
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
9+
})(window,document,'script','dataLayer','GTM-5P98');</script>
10+
<!-- End Google Tag Manager -->
11+
12+
{% endblock %}
13+
14+
{% block header %}
15+
<!-- Google Tag Manager (noscript) -->
16+
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5P98"
17+
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
18+
<!-- End Google Tag Manager (noscript) -->
19+
20+
{{ super() }}
21+
{% endblock %}

0 commit comments

Comments
 (0)