Back to Blog
Technical

How to Implement Cookie Consent on WordPress, Shopify, and Squarespace

GetCookies TeamJanuary 31, 20266 min read
WordPressShopifySquarespaceInstallationHow-To

Why Platform-Specific Guidance Matters

Every website platform handles scripts differently. Where you place your consent management code, how it interacts with the platform's built-in features, and what limitations exist all vary by platform. This guide provides clear, tested instructions for WordPress, Shopify, and Squarespace.

WordPress Installation

WordPress offers the most flexibility for cookie consent implementation. You have two options:

Option 1: Script Installation (Recommended)

  1. Log in to your WordPress admin panel.
  2. Navigate to Appearance > Theme Editor or use a header/footer injection plugin.
  3. Paste your GetCookies script tag in the <head> section, before any other tracking scripts.
  4. Save your changes. The consent banner will appear automatically on all pages.

This approach works with any WordPress theme and is not affected by plugin conflicts.

Option 2: Plugin Installation

If you prefer a plugin approach, search for "GetCookies" in the WordPress plugin directory, install, and activate. The plugin places the script automatically and provides a settings page within your WordPress dashboard.

WordPress-Specific Considerations

  • Ensure your consent script loads before Google Analytics, Facebook Pixel, or any marketing tag.
  • If you use a caching plugin (WP Rocket, W3 Total Cache), exclude the consent script from JavaScript minification and defer.
  • Test with both logged-in and logged-out views, as some caching plugins serve different content to each.

Shopify Installation

Shopify restricts access to certain parts of the page template, but adding consent management is straightforward:

  1. In your Shopify admin, go to Online Store > Themes.
  2. Click Actions > Edit Code.
  3. Open the theme.liquid file.
  4. Paste your GetCookies script tag immediately after the opening <head> tag.
  5. Click Save.

Shopify-Specific Considerations

  • Shopify has its own built-in cookie banner feature, but it does not block cookies before consent and lacks granular controls. Disable Shopify's built-in banner if you use a third-party CMP.
  • Shopify checkout pages have limited script access. Third-party scripts cannot run on checkout pages on standard Shopify plans. However, Shopify Plus merchants can customize checkout scripts.
  • If you use Shopify's Customer Privacy API, your CMP can integrate with it for a more native experience.

Squarespace Installation

Squarespace provides a dedicated Code Injection area that makes script installation simple:

  1. Go to Settings > Advanced > Code Injection.
  2. Paste your GetCookies script tag in the Header field.
  3. Click Save.

The script will load on every page of your Squarespace site.

Squarespace-Specific Considerations

  • Squarespace has a built-in cookie banner, but it provides only an "Accept" option with no granular controls. This does not meet GDPR requirements. Disable it under Settings > Cookies & Visitor Data and use a proper CMP instead.
  • Squarespace sites that use connected third-party services (Google Analytics, Pinterest, etc.) should ensure these are blocked until consent is obtained.
  • Test your banner on both desktop and mobile, as Squarespace templates can behave differently across devices.

Verification After Installation

Regardless of platform, always verify your installation:

  1. Open your website in an incognito/private browsing window.
  2. Check that the consent banner appears before any tracking cookies are set.
  3. Use your browser's Developer Tools (Application > Cookies) to confirm that no non-essential cookies exist before you click "Accept."
  4. Click "Reject All" and verify that no analytics or marketing cookies are set.
  5. Use GetCookies' built-in scanner to run an automated compliance check.

Frequently Asked Questions

Do I need cookie consent on Shopify?
Yes. If your Shopify store uses analytics (Google Analytics, Facebook Pixel, etc.), marketing cookies, or targets customers in the EU/EEA or California, you need a compliant cookie consent solution. Shopify's built-in cookie banner does not provide the granular controls required by GDPR.
Can I add a cookie consent banner to Squarespace without coding?
Yes. You can add a consent management script like GetCookies through Squarespace's Code Injection feature (Settings > Advanced > Code Injection). Paste the script in the Header section and it will work across all pages without modifying templates.
Which WordPress cookie consent plugin is best for GDPR?
Look for a plugin or solution that blocks cookies before consent, provides granular category controls, includes a "Reject All" button with equal prominence, logs consent records, and supports Google Consent Mode v2. Script-based solutions like GetCookies often outperform plugins because they do not depend on WordPress updates or plugin conflicts.
G

GetCookies Team

Contributing writer at GetCookies, specializing in privacy compliance, consent management, and digital marketing optimization.

Ready to Simplify Cookie Consent?

GetCookies makes GDPR, CCPA, and global privacy compliance effortless. Get started today.