diff --git a/docusaurus.config.js b/docusaurus.config.js
index b18311af5c1..1828af77032 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -33,6 +33,8 @@ module.exports = {
// }
// },
// ],
+ // This custom Osano plugin must precede the gtm-plugin.
+ "./static/plugins/osano",
[
require.resolve("docusaurus-gtm-plugin"),
{
diff --git a/src/theme/Footer/index.js b/src/theme/Footer/index.js
index fcccbe2dc2b..b6994164940 100644
--- a/src/theme/Footer/index.js
+++ b/src/theme/Footer/index.js
@@ -7,17 +7,12 @@ import Footer from "@theme-original/Footer";
import { Auth0Provider, useAuth0 } from "@auth0/auth0-react";
import BrowserOnly from "@docusaurus/BrowserOnly";
-import Head from "@docusaurus/Head";
import mixpanel from "mixpanel-browser";
export default function FooterWrapper(props) {
return (
<>
-
- {/* Osano (Consent) */}
-
-
>
);
diff --git a/static/plugins/osano/index.js b/static/plugins/osano/index.js
new file mode 100644
index 00000000000..d9bd0f4c056
--- /dev/null
+++ b/static/plugins/osano/index.js
@@ -0,0 +1,37 @@
+// This is implemented as a plugin because script order is important.
+module.exports = function () {
+ return {
+ name: "osano-plugin",
+ injectHtmlTags() {
+ return {
+ headTags: [
+ {
+ tagName: "script",
+ innerHTML: `
+ // Required prior to loading osano.js script.
+ window.dataLayer = window.dataLayer || []
+ function gtag() {
+ dataLayer.push(arguments)
+ }
+ gtag('consent', 'default', {
+ ad_storage: 'denied',
+ analytics_storage: 'denied',
+ ad_user_data: 'denied',
+ ad_personalization: 'denied',
+ wait_for_update: 500,
+ })
+ gtag('set', 'ads_data_redaction', true)
+ `,
+ attributes: {},
+ },
+ {
+ tagName: "script",
+ attributes: {
+ src: "https://cmp.osano.com/16CVvwSNKHi9t1grQ/2ce963c0-31c9-4b54-b052-d66a2a948ccc/osano.js",
+ },
+ },
+ ],
+ };
+ },
+ };
+};