Skip to content

Commit

Permalink
Merge pull request #641 from pupil-labs/add-ga4-analytics
Browse files Browse the repository at this point in the history
Add Google Analytics tracking code to head
  • Loading branch information
marc-tonsen authored Nov 28, 2023
2 parents 31db150 + 10ed151 commit f33670c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion default_config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,21 @@ type ThemeConfigProps = {
};

export const config: ConfigProps = {
head: [["link", { rel: "icon", href: "/favicon.png" }]],
head: [
["link", { rel: "icon", href: "/favicon.png" }],
[
"script",
{
async: "",
src: "https://www.googletagmanager.com/gtag/js?id=G-YSCHB0T6ML",
},
],
[
"script",
{},
"window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-YSCHB0T6ML');",
],
],
appearance: true,
cleanUrls: true,
};
Expand Down
13 changes: 13 additions & 0 deletions landing-page/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ const config_additions = {
titleTemplate: ":title - Pupil Labs Docs",
description: "Documentation for all Pupil Labs products.",
head: [
["link", { rel: "icon", href: "/favicon.png" }],
[
"script",
{
async: "",
src: "https://www.googletagmanager.com/gtag/js?id=G-YSCHB0T6ML",
},
],
[
"script",
{},
"window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-YSCHB0T6ML');",
],
[
"script",
{},
Expand Down

0 comments on commit f33670c

Please sign in to comment.