From 4583e0f47bc86a4b57115773cd1a653ae72431d6 Mon Sep 17 00:00:00 2001 From: ArchFeh Date: Fri, 7 Jun 2024 17:01:05 +0800 Subject: [PATCH] add GA Signed-off-by: ArchFeh --- config/_default/params.toml | 4 ++-- data/consent.yaml | 5 +++++ static/js/ga.js | 11 +++++++++++ themes/hugo-liftoff | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 data/consent.yaml create mode 100644 static/js/ga.js diff --git a/config/_default/params.toml b/config/_default/params.toml index 12d1bdc..81c585b 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -16,8 +16,8 @@ label_drafts = true # Add a label indicator next to the title of any built draft # Customize newsletter text newsletter_header = "PLCT Lab" newsletter_description = "This is my custom newsletter description that tells you why you should sign up." -newsletter_submit = "Join now" -global_newsletter = false # Enable newsletter site-wide +newsletter_submit = "Subscribe" +global_newsletter = true # Enable newsletter site-wide # CSS / JavaScript enable_postcss = false # Enable if you're using npm and want to utilize PostCSS processing diff --git a/data/consent.yaml b/data/consent.yaml new file mode 100644 index 0000000..e9fdb75 --- /dev/null +++ b/data/consent.yaml @@ -0,0 +1,5 @@ +items: + - title: Google Anaytics (functional) + description: This code gives us insight into the number of people that visit our website, where they are from and what they are clicking on. We follow the guidelines of the Dutch Government, which describe how to use Google Analytics without requiring explicit consent. + is_functional: true + script_file: ga.js diff --git a/static/js/ga.js b/static/js/ga.js new file mode 100644 index 0000000..e900e19 --- /dev/null +++ b/static/js/ga.js @@ -0,0 +1,11 @@ +var _gaq = _gaq || []; +_gaq.push(['_setAccount', 'G-1WLCFRCXQZ']); +_gaq.push(['_gat._forceSSL']); +_gaq.push(['_gat._anonymizeIp']); +_gaq.push(['_trackPageview']); + +(function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); +})(); \ No newline at end of file diff --git a/themes/hugo-liftoff b/themes/hugo-liftoff index 25f1592..a22d1de 160000 --- a/themes/hugo-liftoff +++ b/themes/hugo-liftoff @@ -1 +1 @@ -Subproject commit 25f1592f91fb1e8b69229573b13f6bbf4be0b1bc +Subproject commit a22d1dedf8c0e34e28c159fd48bd71540d087a46