Skip to main content
All CollectionsWeb CheckoutManuals
How to Implement Promotions in the Web Checkout
How to Implement Promotions in the Web Checkout

Learn how to apply promo codes in Ventrata using the data-config attribute or dynamic URL-based methods.

Lucia Burin Sestakova avatar
Written by Lucia Burin Sestakova
Updated this week

How it Works

Ventrata allows you to apply promotions to products in multiple ways:

  • using dashboard settings to enable promotions across multiple channels,

  • allowing customers to manually enter promo codes during the checkout flow.

For more details on these methods, refer to the linked articles in each bullet point.

This article focuses on programmatic methods for applying live promotions through:

Ventrata automatically extracts the promo code value from either:

  • the data-config attribute (method 1)

  • the URL query parameter (method 2)

  • or stores the promo code value in Session Storage, see Dynamic Promo Code Insertion (method 2)

Once extracted, the promo code is included in the payload for availability and calendar requests.

πŸ“— TIP
A request payload contains the data sent from the user's browser to the server when making a request (such as checking availability or booking a ticket).

1. Update Data-Config

This method requires access to the data-config attribute. See the Implementation Guide for more information.

How to Implement

  1. Modify the data-config attribute to include the promoCode value:

    <button type="button" data-config='{"productID":"[YOUR_APIKEY]", "promoCode": "[PROMO_CODE]"}' ventrata-checkout > Book Now </button>

    ​



    πŸ“’ NOTE

    You can specify the promoCode value either in the script or directly above the required button.


  2. Once the promoCode value is extracted from the data-config, it is included in the payload for availability and calendar requests. For more details, see how it works.

2. Dynamic Promo Code Insertion

You can apply the promotion by dynamically extracting the promoCode value from the URL query parameters.

There are two ways to dynamically insert a promo code from the URL query parameters:

1. Session Storage

This method ensures that the promoCode value persists even if the promo code is no longer present in the URL. Session Storage keeps promo code active for as long as the browser tab remains open.

πŸ“— TIP

Session Storage is temporary and only lasts while the browser is open. Once the user closes the browser tab or quits the browser, the data is cleared.

2. Query Parameter from the URL

If you share a URL like:

Ventrata automatically extracts the FREE value from the URL and stores it in:

  • Session Storage

  • Payload for availability and calendar requests


Verify Promotion Insertion

Make a Test Booking

To verify that the promo code has been applied, make a test booking. The respective product will be discounted by the promotion value or made free, depending on the promotion settings.

Inspect Payload

You can verify the applied promo code in your browser's developer tools.

  1. Open your web checkout and select a unit and time slot on the product with the promo code.

  2. Open the developer tools in your browser (F12 or right click anywhere on the page > select Inspect).

  3. Navigate to the Network tab.

  4. Select the 'availability' or 'calendar' request in the 'Name' column.

  5. On the right-hand side, switch to the Payload tab.

  6. Look for the "offerCode" parameter in the Request Payload.

  7. Confirm that the code used matches the expected promo code.

Did this answer your question?