mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-10-20 13:23:02 +00:00
Add Google Analytics 4 to the Velero website (#10583)
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 8s
Run the E2E test on kind / get-go-version (push) Failing after 13s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 7s
Main CI / get-go-version (push) Failing after 7s
Main CI / Build (push) Skipped
Scorecard supply-chain security / Scorecard analysis (push) Skipped
Run the E2E test on kind / setup-test-matrix (push) Failing after 4s
e2e-test-kind.yaml / extract (push) Failing after 8s
Run the E2E test on kind / get-go-version (push) Failing after 13s
Run the E2E test on kind / build (push) Skipped
Run the E2E test on kind / run-e2e-test (push) Skipped
push.yml / extract (push) Failing after 7s
Main CI / get-go-version (push) Failing after 7s
Main CI / Build (push) Skipped
Scorecard supply-chain security / Scorecard analysis (push) Skipped
Adds a gtag.js partial wired into both site head templates (baseof.html and head-docs.html) so every page on velero.io reports into a single GA4 property. The Measurement ID (G-XX7MWLVX37) is a CNCF-provisioned property for the Velero project (CNCF Service Desk CNCFSD-3824). The tag renders only in production builds, so local development and Netlify PR previews are excluded from the data. This also satisfies the CLOMonitor analytics check for our CNCF incubation work. Signed-off-by: Shubham Pampattiwar <spampatt@redhat.com>
This commit is contained in:
@@ -7,6 +7,7 @@ frontmatter:
|
||||
date: [":filename", ":default"]
|
||||
params:
|
||||
author: Velero Authors
|
||||
googleAnalytics: G-XX7MWLVX37
|
||||
logo: Velero.svg
|
||||
cncf_logo: cncf-color.svg
|
||||
hero:
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
{{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
|
||||
{{ block "siteTitle" . }}<title>{{ .Site.Title }} {{ .Page.Title }}</title>{{ end }}
|
||||
{{ partial "google-analytics.html" . }}
|
||||
</head>
|
||||
<body id="{{ .CurrentSection.Params.id }}">
|
||||
<div class="container-fluid site-outer-container">
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
{{/*
|
||||
Google Analytics 4 (gtag.js).
|
||||
|
||||
Renders only in production builds (Netlify runs `hugo` with the production
|
||||
environment, so local `hugo server` and PR previews stay out of the data).
|
||||
The Measurement ID is read from `params.googleAnalytics` in config.yaml.
|
||||
*/}}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ with .Site.Params.googleAnalytics }}
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ . }}');
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
@@ -8,4 +8,5 @@
|
||||
{{ $styles := resources.Get "styles.scss" | toCSS $options | resources.Fingerprint }}
|
||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
|
||||
{{/* TODO {% seo %}*/}}
|
||||
{{ partial "google-analytics.html" . }}
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user