Important: We will set up the checkout journey and analytics tracking based on the specifications in this document. These may stop working properly if you make incompatible changes to your website.
We need your website to:
This page is the initial page users see when they press the “Go To Checkout” button on the native bag page.
This page is the page users see when they successfully place an order.
URL of this page must have order_completed
as one of its query parameters. E.g. https://myshop.com/checkout?order_completed
For tracking analytics data accurately, you must include a parameterless JavaScript function named getPoqOrder
in the page. An example implementation is as follows:
<script type="text/javascript">
function getPoqOrder() {
return {
"orderId" : "0776620100",
"subTotal" : 10.00,
"delivery" : 5.00,
"discount" : 2.00,
"total" : 13.00,
"currency": "GBP"
};
}
</script>
continue_shopping
as one of its query parameters (e.g. https://myshop.com/checkout?continue_shopping) We listen to this URL change to natively detect the button is pressed and close the web view.As a guideline, you can use the following sample HTML that includes all the required elements for our app to work. Highlighted in the comments are the placeholders variables that need to be changed to match your app values.
<html>
<head>
<script type="text/javascript"> //This is the javascript to get the analytcs data
function getPoqOrder() {
return {
orderId: "85JG-H29L-211P-WX91", //String - populate this with the order id coming from your system
subTotal: 12.99, //Float - total amount of the products purchased before discounts
discount: 2.99, //Float - total amount of discounts applied to that order
delivery: 2.50, //Float - delivery charges for that order
total: 12.50, //Float - total amount of the order with delivery charges after discounts
currency: "GBP" //String - currency isocode (e.g. GBP)
};
}
</script>
<title>Web Checkout</title>
<link rel="stylesheet" type="text/css" href="_styles/styles.css">
</head>
<body>
<h1>Thanks for your order!</h1>
<div><!-- Order details --></div>
<!-- This button with that href is required in order to close down the webview once the order is completed. The copy of the button can be changed. -->
<a id="continue" href="/?continue_shopping">Continue Shopping</a>
</body>
</html>
It is best if your back-end provides HTML pages that are optimised and tested for embedding in an app web view.
To style the pages and hide navigation and other links you may use the CSS and JavaScript injection on the CMS. When you set up custom CSS styles or custom JavaScript using this feature the CSS and the JavaScript code is automatically inserted into the web pages.