From aa9b602e004176d3c995491e1736c6318f6cbc71 Mon Sep 17 00:00:00 2001 From: "David B. Kinder" Date: Thu, 6 Jun 2019 14:13:56 -0700 Subject: [PATCH] doc: add google analytics tracking to docs This adds code to each page needed for gathering google analytics tracking data to the LF-provided Global site tag. Signed-off-by: David B. Kinder --- doc/conf.py | 3 +++ doc/static/ga-tracker.js | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 doc/static/ga-tracker.js diff --git a/doc/conf.py b/doc/conf.py index 4090cdee964..53ffb18e2d6 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -555,4 +555,7 @@ linkcheck_anchors = False def setup(app): app.add_stylesheet("zephyr-custom.css") + + app.add_javascript("https://www.googletagmanager.com/gtag/js?id=UA-831873-47") + app.add_javascript("ga-tracker.js") app.add_javascript("zephyr-custom.js") diff --git a/doc/static/ga-tracker.js b/doc/static/ga-tracker.js new file mode 100644 index 00000000000..7f322d42add --- /dev/null +++ b/doc/static/ga-tracker.js @@ -0,0 +1,10 @@ +// + +// Copyright (c) 2019, Intel Corporation +// SPDX-License-Identifier: Apache-2.0 + + + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'UA-831873-47');