Secure Privacy

How to Install Secure Privacy on Your Drupal Website: Step-by-Step Guide

[CMP v1] Learn how to install Secure Privacy on your Drupal website using the Header and Footer Scripts module with easy-to-follow steps and screenshots.

SPT
Secure Privacy Team
2 min read ()

Drupal is a powerful open-source digital experience management system used by over 1 million contributors worldwide to deliver personalized web content at scale. This guide explains how to install the Secure Privacy cookie consent script on a Drupal 8 or 9 website using the Header and Footer Scripts module.

Before you begin: You will need your unique Secure Privacy installation script. Log in to your Secure Privacy account at secureprivacy.ai and copy the script from the Domains → Installation page.

Who Is This Guide For?

  • Website administrators managing Drupal 8.x or 9.x websites

  • Developers integrating Secure Privacy with a Drupal-powered website

In this guide:

The Secure Privacy integration for Drupal 8/9 uses the Header and Footer Scripts module. Download it here: Header and Footer Scripts Drupal Module.

If you are already experienced with installing Drupal modules, skip directly to Step 2.

Download the Module

  1. Navigate to the "Downloads" section on the module page.

  2. Copy the URL for the latest Drupal release. It will look similar to:
    https://ftp.drupal.org/files/projects/header_and_footer_scripts-3.0.0.tar.gz

Drupal.org Header and Footer Scripts module page showing the Downloads section with the latest release link to copy

Install and Enable the Module in Drupal 8/9

  1. In your Drupal admin dashboard, navigate to Manage → Extend and click "Add new module."

  2. Paste the copied module URL into the "Install from a URL" field and click "Continue."

Drupal Extend page showing the Add new module option and the Install from a URL field for the Header and Footer Scripts module
  1. Once uploaded, locate "Header and Footer Scripts" in the Extend module list.

Drupal Extend module list showing the Header and Footer Scripts module ready to be enabled
  1. Check the checkbox next to "Header and Footer Scripts" and click "Install" to enable the module.

Drupal Extend page with the Header and Footer Scripts module checkbox selected and the Install button highlighted
  1. In your Drupal admin dashboard, navigate to Configuration → Header and Footer Scripts.

  2. Paste your Secure Privacy installation script into the "Header Scripts" field to ensure it loads before any non-essential cookies are set.

Drupal Header and Footer Scripts configuration page showing the Header Scripts field where the Secure Privacy script should be pasted
  1. Click "Save configuration" to apply the changes.

Drupal Header and Footer Scripts page with the Secure Privacy script entered and the Save configuration button ready to be clicked

The Secure Privacy cookie consent script is now installed on your Drupal website. Your site is ready to manage user consent and GDPR compliance via Secure Privacy.

Common Issues and Fixes

Where do I find my Secure Privacy installation code?

Log in to your Secure Privacy account and navigate to Domains → Installation. Your unique script code is displayed and available to copy from this page.

I don't see "Header and Footer Scripts" in Drupal's Extend menu.

Ensure you uploaded the module correctly using the "Add new module" option and the latest module URL from Drupal.org. After uploading, the module must be enabled by checking its checkbox in the Extend list and clicking "Install."

My Secure Privacy consent banner is not showing after installation.

Clear your Drupal cache and refresh your website. Also confirm the script is correctly pasted in the "Header Scripts" field under Configuration → Header and Footer Scripts — not the Footer Scripts field.

See Also

Need more help?

Our privacy experts are here to guide you through complex regulations and find the right solution.

Contact Support

Related Articles

View all