Skip to main content

Direct snippet

Add the OptSens script tag to your site, first in the page <head>. This method works on every platform and is the one we recommend.

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 while you set the domain up. It looks like this:

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

Replace YOUR_DOMAIN_ID with the value shown in your dashboard.

Where to place it

The script must load first-party in <head>, before any Google or marketing tags. This lets OptSens set consent defaults and start blocking trackers before anything else runs.

  1. Open the HTML template that renders <head> on every page.
  2. Paste the snippet as the first script inside <head>, above Google Tag Manager, Google Analytics, the Meta Pixel and any other tag.
  3. Save and publish.
<head>
<script src="https://cdn.optsens.com/optsens.min.js/YOUR_DOMAIN_ID"></script>
<!-- your other tags go below -->
</head>

Rules to follow

  1. Load the script first-party, from your own page, not through a third-party loader. A banner delivered only through Google Tag Manager does not show in Safari Private Browsing, because Safari blocks googletagmanager.com.
  2. Do not add async or defer. The script needs to run before the tags it manages.
  3. Add the snippet once per page. Additional copies are ignored.

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 for the manual checklist.

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