Onsite Experience Integration

This guide explains how to integrate Uniqodo’s onsite experiences into the front end of an eCommerce website using our JavaScript tag.

🚧

Important

  • You do not need to complete the integration described on this page if you already have the Uniqodo Coupon Integration Tag installed on your website.
  • The Uniqodo tag should be set as strictly necessary in relation to your site's cookie policy to avoid disruption to your promotions.
  • The tag should only be fired once on initial page load, this includes Single Page Applications (SPA).

There are two steps required to complete the Onsite Experience Integration.

Step 1

On every page except the order confirmation page, add the tag as shown below without order parameters.

📘

Note

The "Order Confirmation Page" is the "Thank You" page shown to customers after completing a purchase. This is the page where order is confirmed and order details displayed to a customer immediately after completing their purchase. It may be also be referred to as the Booking Confirmation Page for some businesses.

<script type="text/javascript" async="true" src="https://www.uqd.io/YOUR_UNIQODO_ID_HERE.js"></script>

The step will enable you to:

  1. Use our onsite experience technology (overlays, banners, inline HTML elements) to issue unique codes or display promotional messages to customers on the website.
  2. Automatically populate the coupon code field with unique codes that are issued to customers in overlays and banners.

Step 2

On the order confirmation page(s), place the tag with order parameters as shown below just before the closing HTML </body> tag of the page. You must NOT set these order parameters unless the page is an order confirmation page.


<script type="text/javascript">
    UNIQODO = typeof UNIQODO !== "undefined" ? UNIQODO : {};
    UNIQODO.orderConfirmation = true;
    UNIQODO.orderId = "ORDER_ID_HERE";
    UNIQODO.orderValue = "ORDER_VALUE_HERE";
    UNIQODO.currency = "CURRENCY_HERE";

    // optional merchant custom data
    UNIQODO.p1 = "YOUR_VALUE_HERE"; 
</script>

<script type="text/javascript" async="true" src="https://www.uqd.io/YOUR_UNIQODO_ID_HERE.js"></script>

🚧

Important

The tag must be set to load every time an order is confirmed on every order confirmation page including responsive and mobile optimised versions of the confirmation page. If the tag is absent, Uniqodo will be unable to record and respond to transactions.

This setup allows you to:

  1. Record successful transactions against an experience to measure its performance and A/B test results.
  2. End an onsite experience for a customer after they’ve made a purchase.

A few parameters need to be set for the tag on the order confirmation page(s). Refer to the table below for more information on each parameter.


ParameterDescriptionRequired?FormatExample
UNIQODO.orderIdThe unique ID of the order or booking in the retailer’s systemYesString15ABC1234
UNIQODO.orderValueThe total value of the order after all discounts have been applied excluding delivery costs. If the transaction is a lead type the value should be set to1 YesNumber25.99
UNIQODO.discountThe discount value that the customer received for the order. If there is no discount applied to the transaction then this parameter should be set to an empty string ''NoNumber15.00
UNIQODO.currencyThe three-digit ISO 4217 currency code for the transaction currencyNoStringGBP
UNIQODO.p1
UNIQODO.p2
...

UNIQODO.p21
Optional custom parameters as additional order data for reporting and data analytics purposes.

Use these custom parameters (p1 up to p21) to hold transactional data that you would like Uniqodo to record against the order.

You can pass up to a maximum of 21 custom parameters per order. The values can be a number or a string. E.g.

UNIQODO.p1 = new;
UNIQODO.p2 = "Europe";
NoString or Number

Placeholders

  • The parameter placeholders in CAPS above (e.g. ORDER_ID_HERE) must be replaced with the relevant values for the order.
  • The section - "YOUR_UNIQODO_ID_HERE" - should be replaced with your Uniqodo account ID. This value will be supplied in an email but is also available on the “Integration” page in your Uniqodo account. E.g. if your Uniqodo ID is 1234 then the tag URL should be:

Content Security Policy (CSP)

If your website uses a content security policy you will need to add domain names to your current policy so that the relevant Uniqodo tags will be allowed to function.

The HTTP headers must include the following domain name wildcards:

  • *.uniqodo.com - Calls to API endpoints for qualifying, requesting codes, etc. (connect-src)
  • *.uqd.io - JavaScript sources for main integration tag (script-src)
  • *.promotionx.io - JavaScript and image assets for experiences (script-src, img-src)

More strict policies may require more maintenance as we regularly release new features.
The simplest way to enable Uniqodo features would be to add the above domains to the default-src directive.

📘

See https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP for more information on content security policies for websites.