Skip to content

Commit

Permalink
Merge pull request #228 from flotiq/feature/ga-to-gtm
Browse files Browse the repository at this point in the history
Move from built-in GA to GTM
  • Loading branch information
andrzejwp authored Feb 11, 2024
2 parents 9568830 + 81e82fd commit 1b6d707
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ extra_javascript:

extra:
analytics:
provider: google
property: G-EFYLWPDWJP
provider: custom
social:
- icon: fontawesome/brands/discord
link: https://discord.com/invite/FwXcHnX
Expand Down
9 changes: 8 additions & 1 deletion theme/main.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{% extends "base.html" %}

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

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NZCGJHXG"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}
{% block extrahead %}
<script type="application/ld+json">
{
Expand Down
7 changes: 7 additions & 0 deletions theme/partials/integrations/analytics/custom.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- 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-NZCGJHXG');</script>
<!-- End Google Tag Manager -->

0 comments on commit 1b6d707

Please sign in to comment.