From c280521bc977e211cf542585913e8700f46674a4 Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sat, 16 Nov 2024 11:21:31 +1100 Subject: [PATCH 1/8] Incorporate Google Analytics --- astro.config.mjs | 21 +++++++++++++++++++++ package-lock.json | 23 +++++++++++++++++++++++ package.json | 1 + 3 files changed, 45 insertions(+) diff --git a/astro.config.mjs b/astro.config.mjs index d7d187a4d..44df72a1d 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -4,6 +4,7 @@ import solidJs from "@astrojs/solid-js"; import react from "@astrojs/react"; import starlightLinksValidator from 'starlight-links-validator'; import sitemap from "@astrojs/sitemap"; +import partytown from '@astrojs/partytown'; // https://astro.build/config export default defineConfig({ @@ -15,6 +16,26 @@ export default defineConfig({ starlight({ title: "SplashKit", description: 'SplashKit is a cross-platform game engine for C, C++ and Objective-C. It provides a simple API for 2D game development.', + head: [ + // Google Analytics script tag + { + tag: 'script', + attrs: { + async: true, + src: 'https://www.googletagmanager.com/gtag/js?id=G-1HKE1PH6ZM', + }, + }, + // Google Analytics inline configuration + { + tag: 'script', + children: ` + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-1HKE1PH6ZM'); + `, + }, + ], plugins: [ starlightLinksValidator({ errorOnRelativeLinks: true, diff --git a/package-lock.json b/package-lock.json index 8a694b86c..1df8e44c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.9", "dependencies": { "@astrojs/netlify": "^5.4.0", + "@astrojs/partytown": "^2.1.2", "@astrojs/prism": "^3.1.0", "@astrojs/react": "^3.6.0", "@astrojs/sitemap": "^3.1.6", @@ -213,6 +214,16 @@ "astro": "^4.2.0" } }, + "node_modules/@astrojs/partytown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@astrojs/partytown/-/partytown-2.1.2.tgz", + "integrity": "sha512-1a9T5lqxtnrw0qLPo1KwliUvaaUzPNPtWucD8VxdwT7zqcpODFk1RzGgAgqVo+YhutFrTu/qclbtnOfXBuskjw==", + "license": "MIT", + "dependencies": { + "@builder.io/partytown": "^0.10.2", + "mrmime": "^2.0.0" + } + }, "node_modules/@astrojs/prism": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-3.1.0.tgz", @@ -669,6 +680,18 @@ "node": ">=6.9.0" } }, + "node_modules/@builder.io/partytown": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@builder.io/partytown/-/partytown-0.10.2.tgz", + "integrity": "sha512-A9U+4PREWcS+CCYzKGIPovtGB/PBgnH/8oQyCE6Nr9drDJk6cMPpLQIEajpGPmG9tYF7N3FkRvhXm/AS9+0iKg==", + "license": "MIT", + "bin": { + "partytown": "bin/partytown.cjs" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@ctrl/tinycolor": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.1.0.tgz", diff --git a/package.json b/package.json index ae960a2a7..365e78b6f 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ }, "dependencies": { "@astrojs/netlify": "^5.4.0", + "@astrojs/partytown": "^2.1.2", "@astrojs/prism": "^3.1.0", "@astrojs/react": "^3.6.0", "@astrojs/sitemap": "^3.1.6", From 4ab612d1b1a0a330a06243201e0738add097cd37 Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 1 Dec 2024 10:51:58 +1100 Subject: [PATCH 2/8] Update integration --- astro.config.mjs | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 44df72a1d..cf2b81c3a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -13,27 +13,36 @@ export default defineConfig({ // output: "server", // adapter: netlify(), integrations: [ + partytown({ + config: { + forward: ["dataLayer.push", "gtag"], // Forward both for compatibility + }, + }), starlight({ title: "SplashKit", description: 'SplashKit is a cross-platform game engine for C, C++ and Objective-C. It provides a simple API for 2D game development.', head: [ // Google Analytics script tag { - tag: 'script', + tag: "script", attrs: { - async: true, + type: "text/partytown", src: 'https://www.googletagmanager.com/gtag/js?id=G-1HKE1PH6ZM', + async: true, }, }, // Google Analytics inline configuration { - tag: 'script', - children: ` - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', 'G-1HKE1PH6ZM'); - `, + tag: "script", + attrs: { + type: "text/partytown", + }, + content: ` + window.dataLayer = window.dataLayer || []; + function gtag(){dataLayer.push(arguments);} + gtag('js', new Date()); + gtag('config', 'G-1HKE1PH6ZM'); + `, }, ], plugins: [ From e9d74abe11e6109f97c2d7ee7d7d0105f45efb5a Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 13:33:52 +1100 Subject: [PATCH 3/8] Update to tag permissions, add banner --- astro.config.mjs | 136 ++++++++++++++++++++++++-------- package-lock.json | 16 +++- package.json | 3 +- public/cookieconsent-config.js | 105 +++++++++++++++++++++++++ public/privacy-policy.mdx | 137 +++++++++++++++++++++++++++++++++ 5 files changed, 359 insertions(+), 38 deletions(-) create mode 100644 public/cookieconsent-config.js create mode 100644 public/privacy-policy.mdx diff --git a/astro.config.mjs b/astro.config.mjs index cf2b81c3a..15d90d376 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -2,13 +2,13 @@ import { defineConfig, squooshImageService } from "astro/config"; import starlight from "@astrojs/starlight"; import solidJs from "@astrojs/solid-js"; import react from "@astrojs/react"; -import starlightLinksValidator from 'starlight-links-validator'; +import starlightLinksValidator from "starlight-links-validator"; import sitemap from "@astrojs/sitemap"; -import partytown from '@astrojs/partytown'; +import partytown from "@astrojs/partytown"; // https://astro.build/config export default defineConfig({ - site: 'https://splashkit.io/', + site: "https://splashkit.io/", // base: '/splashkit.io-starlight', // if hosted without domain. // output: "server", // adapter: netlify(), @@ -20,29 +20,50 @@ export default defineConfig({ }), starlight({ title: "SplashKit", - description: 'SplashKit is a cross-platform game engine for C, C++ and Objective-C. It provides a simple API for 2D game development.', + description: + "SplashKit is a cross-platform game engine for C, C++ and Objective-C. It provides a simple API for 2D game development.", head: [ // Google Analytics script tag { tag: "script", attrs: { type: "text/partytown", - src: 'https://www.googletagmanager.com/gtag/js?id=G-1HKE1PH6ZM', + src: "https://www.googletagmanager.com/gtag/js?id=G-1HKE1PH6ZM", async: true, }, }, // Google Analytics inline configuration { tag: "script", + type: "text/partytown", + innerHTML: ` + window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } + gtag('js', new Date()); + gtag('consent', 'default', { + ad_storage: 'denied', + ad_user_data: 'denied', + ad_personalization: 'denied', + analytics_storage: 'granted', + }); + gtag('config', 'G-1HKE1PH6ZM'); + `, + }, + // CookieConsent stylesheet + { + tag: "link", attrs: { - type: "text/partytown", + rel: "stylesheet", + href: "https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@3.0.1/dist/cookieconsent.css", + }, + }, + // CookieConsent configuration script + { + tag: "script", + attrs: { + type: "module", + src: "/cookieconsent-config.js", // Ensure this script exists in the `public/` folder }, - content: ` - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); - gtag('config', 'G-1HKE1PH6ZM'); - `, }, ], plugins: [ @@ -55,18 +76,17 @@ export default defineConfig({ // frames: { // showCopyToClipboardButton: true, // }, - styleOverrides: { borderRadius: '0.5rem' }, + styleOverrides: { borderRadius: "0.5rem" }, useDarkModeMediaQuery: true, }, customCss: [ - "/src/styles/custom.css", "/src/styles/background.css", "/src/styles/cards.css", ], social: { github: "https://github.com/splashkit", - youtube: 'https://www.youtube.com/@splashkit7674' + youtube: "https://www.youtube.com/@splashkit7674", }, favicon: "/images/favicon.svg", logo: { @@ -93,7 +113,6 @@ export default defineConfig({ collapsed: true, autogenerate: { directory: "troubleshoot", collapsed: true }, badge: "New", - }, { label: "Developer Documentation", @@ -104,20 +123,71 @@ export default defineConfig({ collapsed: true, items: [ { label: "Overview", link: "guides/" }, - { label: "Using SplashKit", autogenerate: { directory: "guides/Using-SplashKit", collapsed: false } }, - { label: "Animations", autogenerate: { directory: "guides/Animations", collapsed: false } }, - { label: "Audio", autogenerate: { directory: "guides/Audio", collapsed: false } }, - { label: "Camera", autogenerate: { directory: "guides/Camera", collapsed: false } }, - { label: "Graphics", autogenerate: { directory: "guides/Graphics", collapsed: false } }, - { label: "Input", autogenerate: { directory: "guides/Input", collapsed: false } }, - { label: "Interface", autogenerate: { directory: "guides/Interface", collapsed: false } }, - { label: "Json", autogenerate: { directory: "guides/JSON", collapsed: false } }, - { label: "Networking", autogenerate: { directory: "guides/Networking", collapsed: false } }, - { label: "Raspberry GPIO", autogenerate: { directory: "guides/Raspberry-GPIO", collapsed: false } }, - { label: "Resource Bundles", autogenerate: { directory: "guides/Resource-Bundles", collapsed: false } }, + { + label: "Using SplashKit", + autogenerate: { + directory: "guides/Using-SplashKit", + collapsed: false, + }, + }, + { + label: "Animations", + autogenerate: { + directory: "guides/Animations", + collapsed: false, + }, + }, + { + label: "Audio", + autogenerate: { directory: "guides/Audio", collapsed: false }, + }, + { + label: "Camera", + autogenerate: { directory: "guides/Camera", collapsed: false }, + }, + { + label: "Graphics", + autogenerate: { directory: "guides/Graphics", collapsed: false }, + }, + { + label: "Input", + autogenerate: { directory: "guides/Input", collapsed: false }, + }, + { + label: "Interface", + autogenerate: { directory: "guides/Interface", collapsed: false }, + }, + { + label: "Json", + autogenerate: { directory: "guides/JSON", collapsed: false }, + }, + { + label: "Networking", + autogenerate: { + directory: "guides/Networking", + collapsed: false, + }, + }, + { + label: "Raspberry GPIO", + autogenerate: { + directory: "guides/Raspberry-GPIO", + collapsed: false, + }, + }, + { + label: "Resource Bundles", + autogenerate: { + directory: "guides/Resource-Bundles", + collapsed: false, + }, + }, // { label: "Sprites", autogenerate: { directory: "guides/Sprites", collapsed: false } }, - { label: "Utilities", autogenerate: { directory: "guides/Utilities", collapsed: false } }, - ] + { + label: "Utilities", + autogenerate: { directory: "guides/Utilities", collapsed: false }, + }, + ], // autogenerate: { directory: "guides", collapsed: true }, }, { @@ -129,16 +199,16 @@ export default defineConfig({ // autogenerate: { directory: "arcade-hackathon-project", collapsed: true }, // }, ], - }), - solidJs(), sitemap() + solidJs(), + sitemap(), ], // Process images with sharp: https://docs.astro.build/en/guides/assets/#using-sharp image: { service: squooshImageService() }, server: { host: true, - port: 4322 - } + port: 4322, + }, }); diff --git a/package-lock.json b/package-lock.json index 1df8e44c5..8f707a2b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,8 @@ "squoosh": "0.0.0", "starlight-links-validator": "0.10.1", "swiper": "11.1.3", - "tailwindcss": "3.4.3" + "tailwindcss": "3.4.3", + "vanilla-cookieconsent": "^3.0.1" }, "devDependencies": { "accessible-astro-components": "2.3.6" @@ -6599,15 +6600,16 @@ } }, "node_modules/nanoid": { - "version": "3.3.7", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", - "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -8610,6 +8612,12 @@ "resolved": "https://registry.npmjs.org/validate-html-nesting/-/validate-html-nesting-1.2.2.tgz", "integrity": "sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==" }, + "node_modules/vanilla-cookieconsent": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vanilla-cookieconsent/-/vanilla-cookieconsent-3.0.1.tgz", + "integrity": "sha512-gqc4x7O9t1I4xWr7x6/jtQWPr4PZK26SmeA0iyTv1WyoECfAGnu5JEOExmMEP+5Fz66AT9OiCBO3GII4wDQHLw==", + "license": "MIT" + }, "node_modules/vfile": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", diff --git a/package.json b/package.json index 365e78b6f..6c1843113 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "squoosh": "0.0.0", "starlight-links-validator": "0.10.1", "swiper": "11.1.3", - "tailwindcss": "3.4.3" + "tailwindcss": "3.4.3", + "vanilla-cookieconsent": "^3.0.1" }, "devDependencies": { "accessible-astro-components": "2.3.6" diff --git a/public/cookieconsent-config.js b/public/cookieconsent-config.js new file mode 100644 index 000000000..dcdddee87 --- /dev/null +++ b/public/cookieconsent-config.js @@ -0,0 +1,105 @@ +import 'https://cdn.jsdelivr.net/gh/orestbida/cookieconsent@3.0.1/dist/cookieconsent.umd.js'; + +// Enable dark mode +document.documentElement.classList.add('cc--darkmode'); + +CookieConsent.run({ + guiOptions: { + consentModal: { + layout: "box", + position: "bottom right", + equalWeightButtons: true, + flipButtons: false + }, + preferencesModal: { + layout: "box", + position: "right", + equalWeightButtons: true, + flipButtons: false + } + }, + categories: { + necessary: { + readOnly: true + }, + analytics: { + services: { + ga4: { + label: 'Google Analytics 4', + onAccept: () => { + console.log("Analytics consent granted"); + window.gtag('consent', 'update', { + ad_storage: 'granted', + ad_user_data: 'granted', + ad_personalization: 'granted', + analytics_storage: 'granted', + }); + }, + onReject: () => { + console.log("Analytics consent denied"); + window.gtag('consent', 'update', { + ad_storage: 'denied', + ad_user_data: 'denied', + ad_personalization: 'denied', + analytics_storage: 'denied', + }); + }, + cookies: [ + { + name: /^_ga/, + path: '/', + }, + ], + }, + }, + }, + marketing: {} + }, + language: { + default: "en", + autoDetect: "browser", + translations: { + en: { + consentModal: { + title: "Your Privacy Matters to Us", + description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", + acceptAllBtn: "Accept All Cookies", + acceptNecessaryBtn: "Reject Non-Essential Cookies", + showPreferencesBtn: "Manage Preferences", + }, + preferencesModal: { + title: "Manage Your Privacy Preferences", + acceptAllBtn: "Accept All", + acceptNecessaryBtn: "Reject Non-Essential", + savePreferencesBtn: "Save Preferences", + closeIconLabel: "Close Modal", + serviceCounterLabel: "Service|Services", + sections: [ + { + title: "Why We Use Cookies", + description: "We use cookies to understand how you interact with our website and to improve our resources. Your data will never be used for advertising purposes or shared without your consent." + }, + { + title: "Strictly Necessary Cookies Always Enabled", + description: "These cookies are essential for the basic functionality of our website and cannot be disabled." + }, + { + title: "Analytics Cookies", + description: "Analytics cookies help us gather anonymised data about website usage to improve the user experience. Your data remains secure and is not shared for advertising purposes.", + linkedCategory: "analytics" + }, + { + title: "Advertisement Cookies", + description: "Our website does not use advertisement cookies. We are a non-profit organisation and do not display ads." + }, + { + title: "More Information", + description: "Please see our privacy policy for more information." + } + ] + } + } + } + }, + disablePageInteraction: false +}); \ No newline at end of file diff --git a/public/privacy-policy.mdx b/public/privacy-policy.mdx new file mode 100644 index 000000000..11795d056 --- /dev/null +++ b/public/privacy-policy.mdx @@ -0,0 +1,137 @@ +--- +title: Privacy Policy +sidebar: + label: Privacy Policy +--- + +- **Effective Date:** 10 Dec 24 +- **Owner:** Thoth Tech +- **Contact Details:** thoth.tech.deakin@gmail.com + +At Thoth Tech, we are committed to protecting your privacy and managing your personal information +transparently and responsibly. This Privacy Policy outlines how we collect, use, disclose, and +manage personal information in compliance with the Australian Privacy Principles (APPs). + +--- + +## 1. Information We Collect + +We may collect the following types of personal information: + +- **Analytics Data:** Non-identifiable information about your interaction with our website, such as + pages visited, time spent, and clickstream data. +- **Contact Information:** If you reach out to us directly, we may collect your name, email address, + or other contact details. + +We do not collect sensitive information as defined by the Privacy Act 1988 (Cth), such as health +information, racial or ethnic origin, or religious beliefs, unless explicitly provided by you with +your consent. + +--- + +## 2. How We Collect Information + +We collect information using: + +- **Cookies:** Small text files placed on your device to gather analytics data. +- **Direct Communication:** Information provided by you through forms, emails, or other methods. + +--- + +## 3. Why We Collect Information + +We collect personal information for the following purposes: + +- To understand how users interact with our website. +- To improve the content and features we offer to our community. +- To ensure our resources meet the needs of our user base. + +**Note:** We are a non-profit organisation, and your data will not be used for advertising purposes +or sold to third parties. + +--- + +## 4. Storage and Security of Information + +Your data is stored securely on servers compliant with modern security standards. We implement +reasonable safeguards to protect your information from misuse, interference, loss, unauthorised +access, modification, or disclosure. Data processed through Google Analytics is transmitted securely +using HTTPS encryption and stored on servers adhering to robust privacy and security standards, +including compliance with the General Data Protection Regulation (GDPR) and other relevant privacy +laws. While Google Analytics implements stringent security measures, it is important to note that +data stored on its platform is subject to Google’s data policies and may be accessible to Google +under certain circumstances. We are committed to ensuring that our use of Google Analytics complies +with applicable data protection laws and prioritises the security and privacy of your data. + +--- + +## 5. Disclosure of Information + +We do not disclose personal information to third parties unless required to do so under Australian +law, such as in response to a legal obligation or regulatory requirement, or unless you have +explicitly authorised such disclosure. If it becomes necessary to disclose personal information to +recipients located outside Australia, we will ensure that the disclosure complies with the +Australian Privacy Principles (APPs). This includes taking reasonable steps to ensure that the +overseas recipient handles your personal information in a way that is consistent with Australian +privacy standards. Where practical, we will notify you of the countries in which these recipients +are likely to be located and the nature of the data being disclosed. Our priority is to maintain the +integrity and security of your personal information, regardless of where it is processed or stored. + +--- + +## 6. Access and Correction of Information + +You have the right to access and correct any personal information we hold about you. To request +access or a correction, please contact us at thoth.tech.deakin@gmail.com. We will respond to your +request within a reasonable timeframe. + +--- + +## 7. Complaints + +If you believe we have breached the APPs, you can lodge a complaint by contacting us at +thoth.tech.deakin@gmail.com. We take privacy concerns seriously and will respond promptly to address +your complaint. + +--- + +## 8. Cross-Border Disclosure + +While we primarily store data within Australia, there may be circumstances where data needs to be +disclosed to recipients in other countries, such as when using international cloud storage +providers, analytics tools like Google Analytics, or engaging overseas-based technical support. If +such disclosure is necessary, we will inform you where practical and take all reasonable steps to +ensure that your personal information is handled securely and in accordance with the Australian +Privacy Principles (APPs), including ensuring that overseas recipients provide similar privacy +protections. + +--- + +## 9. Security Disclaimer + +While we strive to protect your data using robust security measures, it is important to note that +transmissions over the internet are not entirely secure and may be subject to risks beyond our +control. Although we take all reasonable steps to safeguard your information, we cannot guarantee +absolute security during transmission and disclaim liability for any data breaches caused by factors +such as cyberattacks, technical failures, or other circumstances beyond our direct control. + +--- + +## 10. Children’s Privacy + +We do not knowingly collect personal data from children under 13 without verifiable parental +consent. If we become aware that we have inadvertently collected personal information from a child +under 13 without such consent, we will take immediate steps to delete the information from our +records. Parents or guardians who believe their child has provided us with personal information +without their consent are encouraged to contact us so we can promptly address the issue + +--- + +## 11. Updates to This Policy + +This Privacy Policy may be updated periodically to reflect changes in our practices or Australian +legal requirements. The latest version will always be available on our website. + +--- + +For further information or inquiries, please contact us at thoth.tech.deakin@gmail.com. \ No newline at end of file From b6caf12c47585af638ad0cd9d688473172e92924 Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 13:39:35 +1100 Subject: [PATCH 4/8] Update privacy-policy location --- {public => src/content}/privacy-policy.mdx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {public => src/content}/privacy-policy.mdx (100%) diff --git a/public/privacy-policy.mdx b/src/content/privacy-policy.mdx similarity index 100% rename from public/privacy-policy.mdx rename to src/content/privacy-policy.mdx From 58be16e770d2647c1fd9cf3b2fcdc0b64379ef43 Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 13:40:37 +1100 Subject: [PATCH 5/8] Update consent banner config --- public/cookieconsent-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/cookieconsent-config.js b/public/cookieconsent-config.js index dcdddee87..cabb41a3a 100644 --- a/public/cookieconsent-config.js +++ b/public/cookieconsent-config.js @@ -62,7 +62,7 @@ CookieConsent.run({ en: { consentModal: { title: "Your Privacy Matters to Us", - description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", + description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", acceptAllBtn: "Accept All Cookies", acceptNecessaryBtn: "Reject Non-Essential Cookies", showPreferencesBtn: "Manage Preferences", @@ -94,7 +94,7 @@ CookieConsent.run({ }, { title: "More Information", - description: "Please see our privacy policy for more information." + description: "Please see our privacy policy for more information." } ] } From 7653da8322e78458eb432526e6a645d49540bc6e Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 13:44:52 +1100 Subject: [PATCH 6/8] Update to privacy policy --- public/cookieconsent-config.js | 4 ++-- src/content/{ => docs/privacy-policy}/privacy-policy.mdx | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename src/content/{ => docs/privacy-policy}/privacy-policy.mdx (100%) diff --git a/public/cookieconsent-config.js b/public/cookieconsent-config.js index cabb41a3a..81e68510b 100644 --- a/public/cookieconsent-config.js +++ b/public/cookieconsent-config.js @@ -62,7 +62,7 @@ CookieConsent.run({ en: { consentModal: { title: "Your Privacy Matters to Us", - description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", + description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", acceptAllBtn: "Accept All Cookies", acceptNecessaryBtn: "Reject Non-Essential Cookies", showPreferencesBtn: "Manage Preferences", @@ -94,7 +94,7 @@ CookieConsent.run({ }, { title: "More Information", - description: "Please see our privacy policy for more information." + description: "Please see our privacy policy for more information." } ] } diff --git a/src/content/privacy-policy.mdx b/src/content/docs/privacy-policy/privacy-policy.mdx similarity index 100% rename from src/content/privacy-policy.mdx rename to src/content/docs/privacy-policy/privacy-policy.mdx From 86e472aa8525e492af090a0e1ab2f32bb4f0e0ea Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 14:07:04 +1100 Subject: [PATCH 7/8] Update policy links --- public/cookieconsent-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/cookieconsent-config.js b/public/cookieconsent-config.js index 81e68510b..9410ec059 100644 --- a/public/cookieconsent-config.js +++ b/public/cookieconsent-config.js @@ -62,7 +62,7 @@ CookieConsent.run({ en: { consentModal: { title: "Your Privacy Matters to Us", - description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", + description: "We use cookies to enhance your experience and gather anonymised analytics data to improve our website. We are a non-profit open-source project and will never use your data for advertising or sell it to third parties. For more details, see our Privacy Policy.", acceptAllBtn: "Accept All Cookies", acceptNecessaryBtn: "Reject Non-Essential Cookies", showPreferencesBtn: "Manage Preferences", @@ -94,7 +94,7 @@ CookieConsent.run({ }, { title: "More Information", - description: "Please see our privacy policy for more information." + description: "Please see our privacy policy for more information." } ] } From 3e7c1d4b61ee9e91f735c7461d6ee9703c761352 Mon Sep 17 00:00:00 2001 From: ShaunR1991 Date: Sun, 15 Dec 2024 14:09:20 +1100 Subject: [PATCH 8/8] Update handlers to check availability of tag. --- public/cookieconsent-config.js | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/public/cookieconsent-config.js b/public/cookieconsent-config.js index 9410ec059..9598b4776 100644 --- a/public/cookieconsent-config.js +++ b/public/cookieconsent-config.js @@ -28,22 +28,30 @@ CookieConsent.run({ label: 'Google Analytics 4', onAccept: () => { console.log("Analytics consent granted"); - window.gtag('consent', 'update', { - ad_storage: 'granted', - ad_user_data: 'granted', - ad_personalization: 'granted', - analytics_storage: 'granted', - }); + if (typeof window.gtag === "function") { + window.gtag('consent', 'update', { + ad_storage: 'granted', + ad_user_data: 'granted', + ad_personalization: 'granted', + analytics_storage: 'granted', + }); + } else { + console.error("gtag is not defined. Ensure Google Analytics is loaded."); + } }, onReject: () => { console.log("Analytics consent denied"); - window.gtag('consent', 'update', { - ad_storage: 'denied', - ad_user_data: 'denied', - ad_personalization: 'denied', - analytics_storage: 'denied', - }); - }, + if (typeof window.gtag === "function") { + window.gtag('consent', 'update', { + ad_storage: 'denied', + ad_user_data: 'denied', + ad_personalization: 'denied', + analytics_storage: 'denied', + }); + } else { + console.error("gtag is not defined. Ensure Google Analytics is loaded."); + } + }, cookies: [ { name: /^_ga/,