Skip to main content

Drupal

Drupal has no OptSens-specific module. Add the OptSens snippet to your site's <head>, either in the active theme or through the Asset Injector module, so it loads on every page.

Get your snippet

Your snippet, with your Domain ID already filled in, is on the Integration page in the dashboard, and in the Integration step of the guided onboarding. It looks like this:

<script src="https://cdn.optsens.com/optsens.min.js/YOUR_DOMAIN_ID"></script>

Add the snippet

  1. In your active theme, edit html.html.twig and paste the snippet inside the <head> element.
  2. Or install the Asset Injector module, add a Code injector, and place the snippet in the header, scoped to all pages.
  3. Clear the cache from Configuration > Performance.

The script must load first-party in <head>, before any Google or marketing tags.

After installing

  1. Open your site in a private window. The banner shows on first visit.
  2. Run the implementation check. During first-time setup it runs as the onboarding Verify step, and you can run it at any time from the dashboard Integration page.
  3. Work through Verify installation.

If the banner does not show, start with Install troubleshooting.