Guest Checkout Hosted Widget
This guide explains how to embed the Guest Checkout Hosted Widget into a web application, including prerequisites, integration steps, the gift purchase flow, and testing.
NoteThe Guest Checkout Hosted Widget supports gift purchases only. Every purchase made through this widget is a gift subscription for a recipient. To let customers buy a subscription for themselves, use the Checkout Hosted Widget.
The Guest Checkout Hosted Widget is a Cleeng hosted customer flow that lets customers buy a subscription as a gift without logging in or creating a Cleeng account. Removing the registration step shortens the purchase flow for one-time gift buyers.
To see the step-by-step guest gift purchase journey, go to the User Flow section of this guide.
If you want to learn more about hosted customer flows, review the currently supported features, and see how they compare to other integration methods, see our overview of available frontend integration options and their benefits.
Key Features
- Gift purchase without login or registration
- Gift purchase form displayed directly, with no purchase mode toggle
- Separate guest session, independent of your site's login state
Overview
Gift subscriptions feature allows you to configure gift offers and let your customers buy them for their friends and family.
Gift subscriptions feature involves:
- Gifter - a person who buys a gift. With the Guest Checkout widget, the gifter doesn't need a Cleeng account.
- Recipient - a person who receives a gift: a current subscriber or a person that doesn't have a subscription yet.
- Gift - a subscription offer that is purchased by a gifter for a recipient.
The Guest Checkout Hosted Widget is used by the gifter to purchase the gift. The recipient redeems it through the Redeem Gift Hosted Widget.
Prerequisites
Before integrating the Guest Checkout hosted widget, make sure you have:
- A Cleeng account.
- The
cleeng.jsembed script integrated on your site. - Guest checkout enabled for your account. Please contact the Cleeng Support Team to enable it.
- A subscription offer created in the Cleeng Dashboard with the Purchasable as a gift option enabled and gift parameters set.
- A dedicated redemption page URL (Checkout URL) and the redemption options (Gift redemption beahvior) configured in the Cleeng Dashboard, with the Redeem Gift Hosted Widget implemented on that page.
- Google reCAPTCHA configured for your account (Cleeng Dashboard > Integration Hub > Identity Management > Google reCAPTCHA).
Code Integration
To embed a Cleeng widget, follow these steps:
1. Include the Cleeng-hosted script in your HTML file
In the index.html, or any HTML file of your app that will be loaded before using a Cleeng widget, include a Cleeng-hosted script in the <head> section of the document.
Production:
<script type="module" src="https://widgets.prod.cleeng.com/cleeng.js"></script>Sandbox:
If you test the widget in Sandbox, the URL for the script will be different:
<script type="module" src="https://widgets.sandbox.cleeng.com/cleeng.js"></script>2. Create a container for the widget
Create an empty HTML container, e.g., <div /> element, with required data as data-* attributes, as in the example below:
<div
data-cleeng-widget="guest-checkout"
data-cleeng-publisher-id="123"
data-cleeng-offer-id="S123_US"
data-cleeng-language="en-US"
/>Where:
-
data-cleeng-widget: The specific Cleeng widget you would like to render. Value:guest-checkout -
data-cleeng-publisher-id: Your unique Cleeng publisher ID (found in the Cleeng Dashboard under Admin & Tools > API Keys). -
data-cleeng-offer-id: The unique ID of the giftable offer (found in the Cleeng Dashboard under Offers & Coupons > Offers > ID column). -
data-cleeng-language: The language displayed to the end user. Supported values:en-USEnglish,ar-AEArabic,nl-NLDutch,fr-FRFrench,de-DEGerman,it-ITItalian,pt-BRPortuguese (Brazil),pt-PTPortuguese (Europe),es-ESSpanish. If you omit this attribute, the widget defaults to Englishen-US.Note: Only one callback: onWidgetEvent is supported for guest checkout. Other communication methods are ignored.
User Flow
-
The gifter clicks a gift purchase button on your site and arrives at guest checkout.
-
The widget displays the gift purchase form directly. No login or registration screen is shown.
-
The gifter enters their first name, last name and email address (entered twice for confirmation).
-
The gifter enters the recipient's details: name, email address (entered twice for confirmation), delivery date, delivery time, and an optional personal message. The widget blocks payment until all required fields are valid.
-
The gifter enters payment details and completes the payment.
-
A confirmation page is presented with a button that will take the gifter to your home page. The gifter will receive a confirmation email.
-
On the delivery date, the recipient receives an email with a redemption link and redeems the gift through the Redeem Gift Hosted Widget.
Note: If the offer is not enabled for gifting, the widget shows an error.
Testing
Test purchasing a gift as a guest
Publisher's side:
- Create a giftable offer in the Cleeng Dashboard.
- Define a redemption page URL in the dashboard. This URL will be sent to a recipient on a delivery date.
- Define redemption options in the dashboard.
Gifter's side:
- Open the page with the Guest Checkout widget in a browser session. Your authentication session in checkout doesn't matter here - the login and registration screen will not be presented.
- Complete the buyer and recipient details with test data and purchase the gift. For test payment methods, see Testing in the Checkout Hosted Widget guide.
- Check that the gift purchase appears in the Cleeng Dashboard. The transaction should be logged in the Gift Report. Additionally, the gifter should be visible in the Customer Accounts as a guest.
Test error handling
- Embed the widget with an offer that doesn't have the Purchasable as a gift option enabled.
- Check that the widget shows an error.
Test redeeming the gift
Follow the steps in Test redeeming a gift in the Redeem Gift Hosted Widget guide.
FAQs
Can I use hosted customer flows solution on Smart TVs or native mobile apps?
No, it's a solution for the web only.
Can I use the checkout.mode property with this widget?
No. Every purchase in the Guest Checkout widget is a gift, so the checkout.mode property doesn't work here. To offer both standard and gift purchases to logged-in customers, use the Checkout Hosted Widget.
What happens if a customer is already logged in on my site?
The widget doesn't use your site's login state. The customer completes the same guest gift purchase flow as any other visitor. As the integrator, you choose which widget to show based on the customerās state. Embed the guest checkout widget for visitors who arenāt logged in, and the regular checkout for logged-in customers.
Does the recipient need a Cleeng account to redeem the gift?
Yes. The recipient must create an account or log in on the redemption page before redeeming the gift. See the Redeem Gift Hosted Widget guide.
Learn more
See Guest Checkout UI Overview.
Updated 15 minutes ago

