Skip to content

Commit f3354aa

Browse files
authored
Analytics: use a site-tag list (open-telemetry#1529)
1 parent 64533fb commit f3354aa

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ params:
5454
github_repo: https://github.com/open-telemetry/opentelemetry.io
5555
github_branch: main
5656
gcs_engine_id: bde3d634eca9cd335
57+
googleAnalytics: "G-QZHM7YEG07, UA-154693307-1"
5758

5859
ui:
5960
footer_about_disable: true
+8-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{{/* Global site tag (gtag.js) - Google Analytics */ -}}
22

3-
{{ $ua_id := "UA-154693307-1" -}}
4-
{{ $ga4_id := "G-QZHM7YEG07" -}}
5-
{{ $ga_id := $ga4_id -}}
3+
{{ with .Site.Params.GoogleAnalytics -}}
64

7-
<script async src="https://www.googletagmanager.com/gtag/js?id={{ $ga_id }}"></script>
5+
{{ $ga_ids := split . ", " -}}
6+
7+
<script async src="https://www.googletagmanager.com/gtag/js?id={{ index $ga_ids 0 }}"></script>
88
<script>
99
window.dataLayer = window.dataLayer || [];
1010
function gtag(){dataLayer.push(arguments);}
1111
gtag('js', new Date());
12-
13-
gtag('config', '{{ $ga_id }}');
14-
gtag('config', '{{ $ua_id }}');
12+
{{ range $ga_ids }}
13+
gtag('config', '{{ . }}');
14+
{{- end }}
1515
</script>
16-
{{- /**/ -}}
16+
{{- end -}}

0 commit comments

Comments
 (0)