Apply to cart
Fanplayr widgets are capable of applying offer codes directly to your store's cart if supported. By supporting this feature, you increase the ease at which your visitors can convert into paying custom
How It Works
You provide Fanplayr with a special
applyToCartUrl
URL as part of your user tracking implementation.Offer widgets that use the Apply to Cart feature will redirect the browser to this URL, replacing the
%c
variable with the offer code to be applied.Upon navigating to this URL your cart software must:
Apply the specified offer code to the cart.
Redirect the user to the cart page.
Best Practice: If the offer is not successfully applied to the cart, show an informative message to the user explaining why the offer was not applied.
Example
The following example shows how you could configure the User tracking aspect of Fanplayr to support the Apply to Cart feature.
If the user is presented a targeted Free Shipping offer with the code FREESHIP
, the widget would navigate the browser to https://example.com/applyOffer.php?code=FREESHIP when this feature is activated.
Custom handler
Sometimes you may not be able to simply hit a URL to apply a coupon. In this case you can supply a function handler to the Fanplayr platform to use when a user clicks the Apply button.