Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added script to include Cookiebot in all pages #30

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/sxastarter/src/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Placeholder, LayoutServiceData, Field, HTMLLink } from '@sitecore-jss/s
import { getPublicUrl } from '@sitecore-jss/sitecore-jss-nextjs/utils';
import Scripts from 'src/Scripts';
import { useRouter } from 'next/router';
import Script from 'next/script';
// Prefix public assets with a public URL to enable compatibility with Sitecore Experience Editor.
// If you're not supporting the Experience Editor, you can remove this.
const publicUrl = getPublicUrl();
Expand Down Expand Up @@ -73,6 +74,22 @@ const Layout = ({ layoutData, headLinks }: LayoutProps): JSX.Element => {
<div id="footer">{route && <Placeholder name="headless-footer" rendering={route} />}</div>
</footer>
</div>

<Script
src="https://cc.cdn.civiccomputing.com/9/cookieControl-9.x.min.js"
strategy={'beforeInteractive'}
></Script>
<Script
id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
data-cbid="c0371d7c-31e2-4caf-92a3-173569d47c4a"
strategy={'beforeInteractive'}
></Script>
<Script
id="CookieDeclaration"
src="https://consent.cookiebot.com/c0371d7c-31e2-4caf-92a3-173569d47c4a/cd.js"
strategy={'beforeInteractive'}
></Script>
</>
);
};
Expand Down