Jump to content

Manually add "squarespace analytics" and "activity protocol" script

Recommended Posts

Is there a separate javascript code that I can run to active squarespace analytics and the activity protocol?

I need to deactivate the squarespace analytics and the activity protocol cookies until the website visitor accepts the data privacy. I cannot use the build-in cookie banner from squarespace as I need to use a more flexible cookie banner script that allows to suppress other cookies as well. Thus, I have deactivated "squarespace analytics" and "activity protocol" by default to be gdpr compliant. I implemented the manual cookie banner script from cookiebot.com which allows to embed and run a js script after consent is given. This is why I am looking for a separate js script to activate "squarespace analytics" and "activity protocol".

What I tried: I added a code injection in <head>-tag to change the value of "isRestrictiveCookiePolicyEnabled" (which I think is responsible for activating squarespace analytics) from true to false but apparently this does not seem to work:

<script data-name="static-context">Static = window.Static || {}; Static.SQUARESPACE_CONTEXT = {,"cookieSettings":{"isCookieBannerEnabled":false,"isRestrictiveCookiePolicyEnabled":false,"isRestrictiveCookiePolicyAbsolute":false,"cookieBannerText":"<p>Bannertext</p>","cookieBannerTheme":"DARK","cookieBannerVariant":"BAR","cookieBannerPosition":"BOTTOM","cookieBannerCtaVariant":"TEXT","cookieBannerCtaText":"OK"}};</script>

I think I am missing something. Maybe there is also another possibility? Would be happy to get help here.

Link to comment
  • Replies 0
  • Views 451
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.