Last updated 05/08/2024
Before adding content preview make sure you have added the initialization script tag.
The content preview feature allows you to limit access to specific web pages on your website to visitors that have authenticated. When the user goes to the page, the content is partially hidden by the content preview sign in section. It can be configured to appear immediately, after a period of time, or when a user scrolls past a certain percent of the page.
You can also customize the text content at the bottom to meet your unique business needs. Once signed in, users can see the page content.
This guide explains how to add content preview to any page on your site, and how to configure the text content you want it to display.
Find the initialization script you have added to your webpage (see initialization script if you have not added it already)
In the initialization script, find the line:
BreadButter.configure({app_id: "[APP_ID]"});
Add the following line under BreadButter.configure();
BreadButter.ui.contentPreview({ restricted_links: ["CONTENT_PREVIEW_PAGE"], scroll_limit: 0, time_limit: 0, clickable_content: false, fixed_height: 0, locale: { POPUP: { TEXT_1: 'HEADER', TEXT_2: 'SUB HEADER', TEXT_3: 'BOTTOM TEXT', TEXT_3_2: 'BOTTOM TEXT EXPANDED', MORE: 'EXPAND LABEL', } }, });
Replace CONTENT_PREVIEW_PAGE with the page (or pages) you want to apply content preview to. Enter the URL like this:
["/work"]
Or like this for multiple pages:
["/work/project-1", "/work/project-2"]
You can also use a wildcard * to block all URLs under /work/, like /work/projects, but not including /work:
["/work/*"]
The remaining fields in the POPUP object allow you to customize the text that appears in the header, and below the sign in options. If you remove the POPUP part of the code snippet, default content will be used.
You should now see the content preview tool appear on the specified page, after the specified time period.
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
Add authentication & API event tracking to your website/app with a script tag & configuration