When this feature is enabled, you will have the option to embed One-Click Action links within Anticipate AI Churn Prevention Emails. This will allow a customer to skip an order or delay the order by a configurable number of days by clicking links in the email. These links will direct the user to a landing page of your choosing, and the action (skip order/delay order) will be executed on the users’ behalf without any further interaction required on their part.
What Value Does It Create?
One-Click Action links help create a frictionless experience for customers and drive increased GMV by preventing or deferring churn. When a customer who is predicted to churn is presented with a quick and accessible way to delay their upcoming order, it is likely that they will choose this path of least resistance, rather than going through the effort of logging into their account, accessing the MSI, and canceling their order/subscription.
Who Can Use It?
This feature is available to any Ordergroove client who has enabled Anticipate AI Churn Prevention Emails (outlined here) and uses one of the following offer serving methods:
- Ordergroove-hosted @ordergroove/offers
- Ordergroove-hosted @ordergroove/offers-legacy
- Self-hosted offers
How Do I Get Started?
Follow the steps listed below. For merchants using Ordergroove-hosted @ordergroove/offers, no additional action is required. For clients using other hosting solutions, complete the additional steps listed for your hosting environment.
Configure One-Click Actions in Ordergroove
- In your Ordergroove Admin, click the Anticipate AI tab.
- Toggle the "Skip & Delay Order Link" option
- Update the ‘Select the number of days you want the order to be delayed’ dropdown to change the default number of days that an order will be delayed through a one-click action link
- Enter a URL in the "URL Redirect" field.
- For all merchants, ensure that this page does not remove URL query parameters. If this page contains logic to strip unexpected query parameters, be sure to add the `token` parameter to the allow-list.
- For merchants with Ordergroove-hosted offers, the URL must resolve to a page that loads Ordergroove’s main.js.
- Press the Save button in the top-right corner.
- Navigate to the Experiences > Emails
- Select “AI Churn Email" from the dropdown list
-
Add a Delay Order link using the template:
and/or add a Skip Order link using the template.{{order.actions.Delay_Order_URL}}
{{order.actions.Skip_Order_URL}}
Additional Steps for @ordergroove/offers-legacy Merchants
After completing the steps listed above, reach out to your Ordergroove representative to finish enabling One-Click Actions and republish your offers package.
Additional Steps for Self-Hosted Merchants
To integrate One-Click Actions, you will need to load the @ordergroove/one-click-action-handler library on the page referenced in the ‘URL Redirect’ option set in the ‘Configure One-Click Actions in Ordergroove’ steps listed above. You will need to add custom code to initialize with `setPublicPath` and `handle` function calls (described below).
-
setPublicPath(path): Path to location on server/CDN where @ordergroove/one-click-action-handler/dist is hosted. Additional code containing token handling logic will be loaded from this path if a token URL parameter is detected on the page.
- handle(experienceName, handlerFunction, [configs]): Detects and decodes the token URL query parameter. If the experience key of the decoded token matches the provided experienceName, the handlerFunction will be invoked. No action will be taken if the page does not contain a token query parameter, the token is unparsable, or if the token encodes an experience that is unregistered.
-
experienceName: Value of the experience key in the decoded token to match against
-
handlerFunction: Function to call when a token associated with experienceName is detected, invoked as handlerFunction(token, configs).
- configs: Object of configuration values to be passed to the handlerFunction. When using one of the provided handler functions, the object should have include entries for:
- env: One of dev/staging/prod. The Ordergroove environment against which REST API calls will be made
- success_modal_header_text: Main text to display in modal displayed after the action has been completed successfully
- failure_modal_header_text: Main text to display in modal displayed if action cannot be completed successfully
- success_modal_subheader_text: Optional subheader text to display in modal displayed after the action has been completed successfully
-
failure_modal_subheader_text: Optional subheader text to display in modal displayed if action cannot be completed successfully
UMD Example:
<html>
<head>
<script src='https://static.merchant.com/one-click-action-handler/dist/tokens.js'></script>
<script type="text/javascript">
og.tokens .setPublicPath('https://static.merchant.com/one-click-action-handler/dist/')
.handle('skip_order', og.tokens.handlers.skip_order, {
env:'staging',
success_modal_header_text: 'Successfully skipped order.',
failure_modal_header_text: 'Your request did not go through.',
failure_modal_subheader_text: 'Please log into your account to skip the order.'
})
.handle('delay_order', og.tokens.handlers.delay_order, {
env: 'staging',
success_modal_header_text: 'Successfully delayed order.',
failure_modal_header_text: 'Your request did not go through.',
failure_modal_subheader_text: 'Please log into your account to delay the order.'
});
</script>
</head>
</html>
Webpack/Node Example:
import tokens from '@ordergroove/one-click-action-manager'
tokens
.handle('skip_order', og.tokens.handlers.skip_order, {
env:'staging',
success_modal_header_text: 'Successfully skipped order.',
failure_modal_header_text: 'Your request did not go through.',
failure_modal_subheader_text: 'Please log into your account to skip the order.'
})
.handle('delay_order', og.tokens.handlers.delay_order, {
env: 'staging',
success_modal_header_text: 'Successfully delayed order.',
failure_modal_header_text: 'Your request did not go through.',
failure_modal_subheader_text: 'Please log into your account to delay the order.'
});
Comments
Please sign in to leave a comment.