Skip to content

Commit

Permalink
Merge pull request #72 from gradle/gtm-support
Browse files Browse the repository at this point in the history
Use Google Tag Manager injection instead of GA4
  • Loading branch information
oleg-nenashev authored Aug 28, 2024
2 parents 5dec258 + 1d8d5b3 commit d41caad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,7 @@ extra:
link: https://mastodon.social/@Gradle
name: Mastodon
analytics:
provider: google
property: G-7W7NC6YNPT
provider: custom

nav:
- Home: README.md
Expand Down
9 changes: 8 additions & 1 deletion overrides/main.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{% extends "base.html" %}


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

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

0 comments on commit d41caad

Please # to comment.