knative / website

Hugo templates for the Knative website.
https://knative.dev
Other
23 stars 70 forks source link

Add Google Analytics tracking ID #262

Closed RichieEscarez closed 3 years ago

RichieEscarez commented 3 years ago

New partial and parameter that uses a copied version of the Hugo internal file used to add first ID.

Given the built in functionality in Hugo (for a single ID only) and to allow all the dependencies Hugo built in to continue working, the second ID is added using its own partial (a modified version of the same "built-in" internal GA feature).

Context:

fixes #253

RichieEscarez commented 3 years ago

Note: Site builds are broken until https://github.com/knative/website/pull/263 gets merged.

We wont be able to test and validate that this is working until then.

vaikas commented 3 years ago

@RichieEscarez now that #263 has been merged, this is good to go? Just adding hold to make sure you can gatekeep if necessary :) /hold /lgtm /approve

RichieEscarez commented 3 years ago

Thanks @vaikas! We need https://github.com/knative/website/pull/260 too before the PR builds will work (so that the staging branch picks up the branch name change too).

RichieEscarez commented 3 years ago

Update: Looks like these knative/website originated builds are working in Netlify (the PR builds that originate from knative/docs are still broken re: #260).

@omerbensaadon This PR seems to be working. Both IDs show in the Preview build: https://deploy-preview-262--knative.netlify.app/.

Whats new/being added now to each page:

<script async="" src="https://www.googletagmanager.com/gtag/js?id=G-YRMNFYE32R"></script>
<script>
var doNotTrack = false;
if (!doNotTrack) {
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
  gtag('config', 'G-YRMNFYE32R', { 'anonymize_ip': false });
}
</script>
csantanapr commented 3 years ago

Nice ! /approve /lgtm

knative-prow-robot commented 3 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csantanapr, vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/knative/website/blob/main/OWNERS)~~ [vaikas] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment