Note: While our most popular guides have been translated into Spanish, some guides are only available in English.
Adding a cookie banner

European Union (EU) laws require website owners to inform their visitors of cookies placed by their website and to receive visitors’ consent to use certain types of cookies. To create an EU cookie banner, follow these steps below.

Tip: We recently changed the default banner text. It was previously “We would like to place cookies on your computer to make this website better.” It’s now “We use cookies to help us improve, promote, and protect our services. By continuing to use the site, you agree to our cookie policy.”

Step 1 - Add the cookie banner

To display a cookie notice banner, you can add a code snippet by following these steps below.

  1. In the Home Menu, click Settings, click Advanced, and then click Code Injection.
  2. Add the following code to the Header Code Injection box.
<script type="text/javascript"> Static.EU_COOKIE_POLICY = "top-left"; </script>
  1. Customize the banner by following these steps (optional):

Change the banner text

To replace the sample text in the banner, use this snippet and replace the message:

<script type="text/javascript">
Static.EU_COOKIE_POLICY = "top-left";
Static.EU_COOKIE_TEXT = 'We use cookies to help us improve, promote, and protect our services. By continuing to use the site, you agree to our cookie policy.';
Static.EU_COOKIE_BUTTON_LABEL = 'Continue';
</script>
Note: EU cookie notice requirements vary depending on your location and cookie use. While we provide sample text for your cookie notice banner, you shouldn’t assume that it satisfies your particular legal requirements. The sample text is only a placeholder to help you get started.

Add a link to your privacy or cookie policy

To create a separate privacy or cookie policy and link to it from your banner, follow these steps:

  1. Add a Regular Page. Name it Privacy Policy or Cookie Policy (or something similar), and add your policy text.
Tip: To hide this page from your navigation menu, add it to the Not Linked section. You can also hide it from search engines.
  1. Copy and paste the snippet below into Code Injection. Replace the sample URL with your page’s full URL.
<script type="text/javascript">
Static.EU_COOKIE_POLICY = "top-left";
Static.EU_COOKIE_TEXT = 'We use cookies to help us improve, promote, and protect our services. By continuing to use the site, you agree to our <a href="https://www.yourdomain.com/cookie-policy" target="_blank">cookie policy</a>.';
Static.EU_COOKIE_BUTTON_LABEL = 'Continue';
</script>
Note: Squarespace can’t provide legal advice on the contents of a Privacy Policy or Cookie Policy page.
  1. Click Save to publish your changes.
  2. To preview the banner, log out of your Squarespace account or open your site in Private Browsing or Incognito mode. Since the banner is custom code, it doesn’t render when you’re logged in.

Step 2 - Restrict Analytics cookies (optional)

Squarespace places Analytics cookies on visitors’ browsers to help you learn more about traffic to your site. To prevent Squarespace from sending Analytics cookies to visitors until they accept your cookie policy, follow these steps.

  1. In the Home Menu, click Settings, and then click Advanced.
  2. Click EU Cookie Banner.
  3. Check Restrict Squarespace Analytics.
  4. Click Save.
Tip: Cookies help us run Squarespace. To learn more about how and why we use cookies, visit our Cookie Policy.
Was this article helpful?
108 out of 131 found this helpful