Last updated 07/08/2024
The One-click form feature makes your forms more effective. When users click on your form, the Bread & Butter ‘Continue with’ widget will prompt users to convert or sign in, and users will have to authenticate before they can fill out the form. One-click forms work with HubSpot forms on a non-HubSpot hosted page (see below), or on a HubSpot hosted page.
After users authenticate, the name and email fields will be auto filled and will not be editable. This prevents users from signing in and then changing their address or name, further increasing the quality of your form submissions.
This guide covers generating your code script, and inserting it onto your form page.
Pre-Requisites: Before getting started, you’ll need your App ID and your User Event code.
Log in to your HubSpot Account.
If you have not already done so, create a HubSpot form using HubSpot's form creation guide:
If you have not done so already, add the HubSpot embed code to your website
Next, add the Bread & Butter JavaScript code to the same page
<script> window.initBreadButter = function () { BreadButter.configure({ app_id: '[APP_ID]' }); }; (function(d, s, id){ var js,fjs=d.getElementsByTagName(s)[0]; if(d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = 'https://cdn.breadbutter.io/dist/breadbutter.7.4.0.1004.min.js'; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'breadbutter-js')); const HUBSPOT_SUBMIT_EVENT = '[EVENT_CODE]'; window.addEventListener('message', event => { if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') { BreadButter.ui.applyHubspotForm(); } else if (event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmit') { if (HUBSPOT_SUBMIT_EVENT) { BreadButter.events.custom(HUBSPOT_SUBMIT_EVENT); } } }); </script>
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