From 7cd22e1bcd53407f43de19917393a9db01e33e29 Mon Sep 17 00:00:00 2001 From: Billy Tat Date: Wed, 14 Dec 2022 09:46:58 -0800 Subject: [PATCH] Enable Analytics --- docusaurus.config.js | 21 +++++++++++++++++++++ package.json | 1 + static/scripts/optanonwrapper.js | 1 + yarn.lock | 5 +++++ 4 files changed, 28 insertions(+) create mode 100644 static/scripts/optanonwrapper.js diff --git a/docusaurus.config.js b/docusaurus.config.js index 36ce7532e8a..35dbf2c0c63 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -136,6 +136,12 @@ module.exports = { ], ], plugins: [ + [ + require.resolve('docusaurus-gtm-plugin'), + { + id: 'GTM-57KS2MW', // GTM Container ID + } + ], [ '@docusaurus/plugin-client-redirects', { @@ -669,4 +675,19 @@ module.exports = { }, ], ], + scripts: [ + { + src: 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js', + type:'text/javascript', + charset: 'UTF-8', + 'data-domain-script': '0f98beb0-fc4c-417d-a42e-564e2cae42d2', + async: true + }, + { + src: '/scripts/optanonwrapper.js', + type:'text/javascript', + async: true + }, + // "/scripts/optanonwrapper.js" + ], }; diff --git a/package.json b/package.json index f86961a5095..c109d588a6b 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@docusaurus/preset-classic": "^2.2.0", "@mdx-js/react": "^1.6.22", "clsx": "^1.1.1", + "docusaurus-gtm-plugin": "^0.0.2", "prism-react-renderer": "^1.3.3", "react": "^17.0.2", "react-dom": "^17.0.2" diff --git a/static/scripts/optanonwrapper.js b/static/scripts/optanonwrapper.js new file mode 100644 index 00000000000..4f78e1ef3f9 --- /dev/null +++ b/static/scripts/optanonwrapper.js @@ -0,0 +1 @@ +function OptanonWrapper() { } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index bc0489b89f8..55a3854c73b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3418,6 +3418,11 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" +docusaurus-gtm-plugin@^0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/docusaurus-gtm-plugin/-/docusaurus-gtm-plugin-0.0.2.tgz#f39864b54ca594e3281902c23b6df0763761602b" + integrity sha512-Xx/df0Ppd5SultlzUj9qlQk2lX9mNVfTb41juyBUPZ1Nc/5dNx+uN0VuLyF4JEObkDRrUY1EFo9fEUDo8I6QOQ== + dom-converter@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768"