Skip to content

Commit

Permalink
Merge pull request #68 from solo-io/adb-gtm
Browse files Browse the repository at this point in the history
Update to use GTM instead of GA4
  • Loading branch information
artberger authored Nov 8, 2023
2 parents ea5bad3 + 6425651 commit 09ca303
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
5 changes: 5 additions & 0 deletions changelog/v0.0.27/google-analytics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/doctopus/issues/86
resolvesIssue: false
description: Updates to use Google Tag Manager (GTM) which contains the GA4 tag.
12 changes: 12 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<!-- 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-52V76X4K');</script>
<!-- End Google Tag Manager -->
{{if .Site.Params.themeStyle}}
{{ partial (printf "%s/head.html" .Site.Params.themeStyle) . }}
{{else}}
{{ partial "flex/head.html" . }}
{{end}}
</head>
<body data-url="{{ .Site.Data.Solo.DocsVersion }}{{ .RelPermalink }}">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-52V76X4K"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

{{if .Site.Params.themeStyle}}
{{ partial (printf "%s/body-beforecontent.html" .Site.Params.themeStyle) . }}
{{else}}
Expand Down
10 changes: 0 additions & 10 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1YGMSXNY49"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'G-1YGMSXNY49');
</script>

<script
type="text/javascript"
id="hs-script-loader"
Expand Down

0 comments on commit 09ca303

Please sign in to comment.