Session offers
With an additional simple integration step, Verada can help prevent unauthorized users from claiming discounts on your store.
This mechanism aims to solve the problem many online stores have faced from coupon sharing sites such as Coupons.com and RetailMeNot. Verada achieves this by limiting the offers it presents to your users so they are only valid during the current visit.
How It Works
You devise a way to identify offer codes that are exclusive to Verada in your system.
- Verada will notify your system when an offer is presented to the user. Your system remembers these offers for the duration of the user's session.
- When a user attempts to apply a Verada offer code, your system only allows it if it remembers the code from the previous step.
Example Flow
One simple method to identify offer codes that are exclusive to Verada is to prepend a special prefix to them.
For example, you might use
"FP_"as the prefix and have a free shipping code,"FP_FREESHIP", defined in your system.You provide Verada with a
sessionOfferUrlas part of your user tracking implementation.For example, the session offer URL might be: https://example.com/allowOffer.php?code=%c
When Verada presents an offer to your users it will invoke the URL (as a GET request) to notify your system that the offer code is valid in the current session.
Your system must store the offer code in an array that is persisted for the duration of the user session. We'll refer to this as the
validSessionCodesarray.Verada will replace the
%cparameter in the URL with the actual offer code. E.g. https://example.com/allowOffer.php?code=FP_FREESHIPYour system must validate offer codes before applying them to the cart. When attempting to apply an Verada code (e.g. it begins with the
"FP_"prefix), it must only be applied to the cart if the code it exists in thevalidSessionCodesarray.If a Verada code does not exist in the array, the code must be considered invalid and rejected by the system.
Example Implementation
1. Configuration
The first step in this process is to supply the sessionOfferUrl to the Verada user tracking snippet. This URL will be invoked with each offer code that is presented to the user. The %c parameter will be replaced with the actual offer code.
E.g. https://example.com/allowOffer.php?code=%c will become https://example.com/allowOffer.php?code=FP_FREESHIP
This configuration step does not apply for custom Javascript Adaptors built by us. In this case, you will need to provide the sessionOfferUrl to us so we can update your integration.
{
type: 'st',
accountKey: '7e43c8cddccade2b95ee5286ba89758a',
sessionOfferUrl: 'https://example.com/allowOffer.php?code=%c',
data: {
// User tracking data
}
}2. Storing session offers in your system
Next you'll need to implement a new endpoint in your system that captures Verada offer codes as they are presented to your users and adds them to an array for the duration of the user session.
The URL you specify in the sessionOfferUrl variable will be invoked as a GET request by the Verada widget.
3. Validate offers being applied to the cart
For the final step, you'll need to make a small change to your system so that it validates all offer codes before applying their discounts.
We've provided an implementation example of a method that could be used to validate codes that begin with the FP_ prefix. Only the codes that begin with this prefix will be checked to ensure they were actually presented by Verada during the user's session. All other non-prefixed codes will be considered valid immediately.
This method should be used throughout your system in any place that an offer code can be applied to the cart.
JavaScript alternative
If a server-side URL is not suitable — for example, if you need to store session offer codes in localStorage or invoke a client-side cart API — you can implement the sessionOffer capability in JavaScript instead of providing a sessionOfferUrl.
See Capabilities — Session Offer for full details and examples.