Skip to content

Commit

Permalink
Add custom Google Tag Manager integration and update analytics provid…
Browse files Browse the repository at this point in the history
…er in mkdocs.yml
  • Loading branch information
almog-lv committed Apr 7, 2024
1 parent e159701 commit 5218a6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
3 changes: 1 addition & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ plugins:
extra:
generator: false
analytics:
provider: google
property: ${{ secrets.GOOGLE_ANALYTICS_ID }}
provider: custom
social:
- icon: fontawesome/brands/github
link: https://github.com/Codium-ai
Expand Down
10 changes: 10 additions & 0 deletions overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{% extends "base.html" %}

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

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-PQP59F54"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endblock %}
7 changes: 7 additions & 0 deletions overrides/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-PQP59F54');</script>
<!-- End Google Tag Manager -->

0 comments on commit 5218a6d

Please sign in to comment.