Overview
This feature enables users to customize the redirect URL after purchasing a package or membership through the V2 Embed Widgets. While the default redirect URL, set in the Hapana V2 Admin will remain, this feature allows users to define a specific redirect URL within the embed widget, offering greater flexibility and control on a customers buying experience.
Description
A gym may integrate the Hapana packages embed widget on their promotional landing page. When a customer purchases a membership, the gym may want the client to be redirected to a unique thank-you page containing tailored promotional content, based on the package they bought. By adding the redirect-url parameter to the widget, the business ensures customers are taken directly to the customized thank-you page, improving the post-purchase experience.
Case 1 - Redirect URL attribute is not added (Current Functionality)
Example widget:
<hapana-widget data-type="packages" widget-id="XXX" package-id="" variant=""></hapana-widget> <script src="https://widget.hapana.com/hapana_widget.js"></script>
Flow:
-
This is how the embed widget presents prior to this new functionality.
-
If the redirect-url attribute is not added, the page will redirect according to the URL set in the Brand's Admin configuration.
-
If no URL is set in the Brand's Admin configuration then there is no redirect following a purchase on the widget.
Admin Widget Redirect URL Option
Case 2 - Custom Redirect URL is added to the widget code with a URL specified
Example widget
<hapana-widget data-type="packages" widget-id="XXX" redirect-url="https://hapana.com" package-id="" variant=""></hapana-widget> <script src="https://widget.hapana.com/hapana_widget.js"></script>
Flow:
-
When the web engineer adds the new parameter, a customer will be redirected to the URL specified in the redirect-url parameter within the widget, following a purchase. This will override any redirect URL set in the Brand's Admin configuration.
Case 3 - Custom Redirect URL is added to the widget code with an Empty Redirect URL
Example widget
<hapana-widget data-type="packages" widget-id="XXX" redirect-url="" package-id="" variant=""></hapana-widget> <script src="https://widget.hapana.com/hapana_widget.js"></script>
Flow:
-
When the web engineer adds the new parameter but with a null value, the page will not redirect to any other URL following a purchase. Even if the Brand's Admin is configured with a redirect URL, the empty redirect-url in the widget will override this setting, ensuring no redirection takes place.
Example Configurations
Custom Redirect URL |
Admin Redirect URL |
Desired Output |
Empty |
||
Set to Blank |
No redirect |
|
Set to Blank |
Empty |
No redirect |
Attribute not present |
||
Attribute not present |
Empty |
No redirect |