Skip to content

Commit f01eb5c

Browse files
committed
feat: Google analytics tag
Signed-off-by: Lachezar Lechev <[email protected]>
1 parent da9e443 commit f01eb5c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ twitter_username = "@AeroRust"
2424
twitter_url = "https://twitter.com/AeroRust"
2525
youtube_url = "https://youtube.com/c/AeroRust"
2626
27+
# Google analytics tag
28+
google_tag = "G-NSCZ6RQFN6"
2729
[extra.default.meta]
2830
title = "Welcome to AeroRust (ÄR) - Your launchpad to space"
2931
description = """

templates/base.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@
1919
{{ meta_macros::facebook_meta(title=config.extra.default.meta.title, description=config.extra.default.meta.description, url=current_url, image=get_url(path="images/aerorust-ferris.png")) }}
2020
{{ meta_macros::twitter_meta(title=config.extra.default.meta.title, description=config.extra.default.meta.description, image=get_url(path="images/aerorust-ferris.png")) }}
2121
{% endblock -%}
22+
23+
{% if config.extra.google_tag -%}
24+
<!-- Google tag (gtag.js) -->
25+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ config.extra.google_tag }}"></script>
26+
<script>
27+
window.dataLayer = window.dataLayer || [];
28+
function gtag(){dataLayer.push(arguments);}
29+
gtag('js', new Date());
30+
31+
gtag('config', '{{ config.extra.google_tag }}');
32+
</script>
33+
{% endif -%}
2234
</head>
2335

2436
<body>

0 commit comments

Comments
 (0)