How to add the ‘Opt-in’ tool

Last updated 05/05/2023

Before adding the ‘Opt-in’ tool make sure you have added the initialization script tag.

The ‘Opt-in’ tool lets you easily add user validation and authentication directly onto any page, and have it fit seamlessly with the rest of the elements around it. It also returns your users back to the current page after authentication.

This guide explains how to add the ‘Opt-in’ tool to your site.

Step 1

Find the initialization script you have added to your webpage (see initialization script if you have not added it already)


Step 2

  • Add a Div block to the location on your page where you want the 'Opt-in' tool to appear.
  • Set the Div name to: bb-optin-tool

Step 3

In the initialization script, find the line:

BreadButter.configure({app_id: "[APP_ID]"});

Step 4

Add the following line under BreadButter.configure();

BreadButter.ui.optIn('bb-optin-tool');


Don’t use Bread & Butter? Want to learn more about how Bread & Butter solves the four biggest problems facing marketers today? Book a demo and see how Bread & Butter is helping marketers make the most of their first-party data