Learn how to generate and embed a snippet that lets customers join your loyalty program directly on your own website, without leaving your domain.
Before you begin
- This requires Dutchie Loyalty & Marketing Pro.
- You'll need the ability to add a
<script>snippet to your website, or a developer who can.
Generate your embed snippet
- In Dutchie E-Commerce, click All Locations to access your enterprise/chain admin page.
- Select Settings > Enrollment.
- By default, the enrollment form displays directly on the page where the code is placed. This is recommended for a dedicated Rewards or Loyalty page. Optionally, check the box for Open in a modal overlay to instead open the form in its own modal. When this box is checked, the generated script URL will include
?mode=modaland the form will open as a full-page overlay. - Find the Embed Code panel and click Copy Script.
Add the snippet to your website
- Open your website editor and edit the page where loyalty signup should appear, typically your Rewards, Loyalty, or Join page.
- Add a custom code block. Choose a block type such as Custom HTML, Embed, Code, or Custom Liquid. Do not paste the snippet into a standard rich-text paragraph, as many editors strip out
<script>tags from text blocks. - Paste your snippet and publish the page. Place only one Dutchie loyalty embed per page so the element ID remains unique.
Common website builders
- WordPress: Add a Custom HTML block.
- Shopify: Add a Custom Liquid section or block.
- Squarespace: Add a Code block and confirm scripts are enabled for the page.
- Webflow: Add an Embed element.
- Custom site: Place the snippet in the HTML body where the form should render.
What customers see
The embedded form matches your "Buttons & Links" color and shape settings from Dutchie E-Commerce Admin, and removes Dutchie navigation and branding so it feels native to your site.
Customers verify their identity with a code sent to their phone or email rather than a password. This applies to both new and existing customers, reducing duplicate accounts.
Listen for signup events (developers)
The embedded form fires two custom DOM events you can hook into for your own analytics or confirmation messaging:
dutchie:loyalty:successdutchie:loyalty:error
Handle Shop Now after enrollment
Important navigation step: When a shopper finishes enrolling and clicks Shop Now, the embedded form deliberately avoids forcing a page redirect. Instead, it dispatches a dutchie:loyalty:success event so your website maintains full control over where to navigate the shopper.
Add a listener for dutchie:loyalty:success to your page. The event detail contains your enterprise's configured landingPageUrl. Here is the standard implementation:
<script>
document.addEventListener('dutchie:loyalty:success', function (event) {
var destination = event.detail && event.detail.landingPageUrl;
if (destination) {
window.location.assign(destination);
}
});
</script>This script tag can be placed anywhere on the page, as long as it loads before the shopper completes enrollment and clicks Shop Now.
Directing shoppers to a custom destination
If you want shoppers always redirected to a specific menu or catalog URL on your site, you can ignore landingPageUrl and specify your own path:
<script>
document.addEventListener('dutchie:loyalty:success', function () {
window.location.assign('/menu');
});
</script>Optional lifecycle events: The embed also dispatches dutchie:loyalty:loaded when the widget finishes mounting, and dutchie:loyalty:error if enrollment encounters an error. You can hook into these for analytics tracking or custom messaging if desired.
Verify the installation
- Open your published website page in a private or incognito window.
- Confirm the loyalty form appears and displays your dispensary rewards program branding.
- For multi-state retailers, choose a state. For single-state retailers, confirm the state is preselected.
- Click Start earning rewards and confirm that sign-in/enrollment options load.
- Complete a test enrollment, click Shop Now, and verify that the page navigates to your intended menu or landing page.
- Test the page on both desktop and mobile viewports.
Custom branding: Your embedded form will inherit your configured button and link colors, font choices, and corner radiuses configured in Dutchie Admin.
Troubleshooting
The "Embed code" panel is missing
Verify you are logged in with an Enterprise Admin account, that your enterprise uses Dutchie POS loyalty, and that you have an enrollment page configured. If you still don't see it, contact Dutchie Support to confirm rollout availability for your enterprise.
The website displays the code as raw text
The snippet was likely pasted into a standard text or rich-text editor block. Move the code into a dedicated Custom HTML, Code, Embed, or Custom Liquid block.
Nothing appears or the script returns a 404
Copy the snippet again from Dutchie Admin. Avoid manually typing or altering the enterprise slug in the script URL.
Clicking "Shop Now" doesn't navigate
Ensure that your website includes the dutchie:loyalty:success event listener described above. The embed emits this event on success but leaves the actual window navigation up to your host page.
Your website has a Content Security Policy (CSP)
If your website enforces a Content Security Policy, ensure your script-src and frame-src directives allow https://dutchie.com.
The form appears twice on the page
Check your page blocks for duplicate snippets. Each page should contain only one Dutchie loyalty embed.
Need assistance?
Contact Dutchie Support with your dispensary name, website URL, platform (WordPress, Shopify, Squarespace, Webflow, etc.), and any console error messages.