Skip to content

Commit 1c95f60

Browse files
committed
Added cookies consent banner to docs.
1 parent 1b00ca8 commit 1c95f60

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

packages/react-renderer-demo/src/app/pages/_document.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ class MyDocument extends Document {
2121
crossOrigin="anonymous"
2222
/>
2323
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
24+
<link rel="stylesheet" type="text/css" href="//wpcc.io/lib/1.0.2/cookieconsent.min.css" />
25+
<script src="//wpcc.io/lib/1.0.2/cookieconsent.min.js"></script>
2426
</Head>
2527
<body>
2628
<Main />
@@ -30,15 +32,22 @@ class MyDocument extends Document {
3032
dangerouslySetInnerHTML={{
3133
__html: `
3234
(function() {
33-
window.dataLayer = window.dataLayer || [];
34-
function gtag(){dataLayer.push(arguments);}
35-
gtag('js', new Date());
36-
37-
gtag('config', 'UA-164334905-1');
35+
if(!window.location.origin.includes("localhost")) {
36+
window.dataLayer = window.dataLayer || [];
37+
function gtag(){dataLayer.push(arguments);}
38+
gtag('js', new Date());
39+
40+
gtag('config', 'UA-164334905-1');
41+
}
3842
})()
3943
`
4044
}}
4145
></script>
46+
<script
47+
dangerouslySetInnerHTML={{
48+
__html: `window.addEventListener("load", function(){window.wpcc.init({"border":"thin","corners":"small","colors":{"popup":{"background":"#f6f6f6","text":"#000000","border":"#555555"},"button":{"background":"#555555","text":"#ffffff"}}})});`
49+
}}
50+
/>
4251
</body>
4352
</html>
4453
);

0 commit comments

Comments
 (0)