Customize.cz integration: script, feeds and API

This page summarises what deploying Customize.cz means technically. The detailed feed specification is in the PDF documentation below. For the general process see How it works; for box setup see the recommendation boxes overview.

Integration options

  • JavaScript snippet – see JavaScript script.
  • Google Tag Manager – the same snippet added as a Custom HTML tag, triggered on the store's pages, with no change to the template.
  • REST API – Box API and Logger API.
  • Point-and-click wizard – deployment with no IT work; we set up the box positions together with you.

JavaScript snippet

The tracker.js script loads asynchronously and receives its commands through the _cmq queue. To display a box you pass the site identifier, the box ID, the ID of the element the box is rendered into and the page context (product ID, category or basket contents). After an order is completed, the conversion action is sent from the confirmation page.

Displaying a box

Place an empty element where the box should appear and the commands below it. Load the tracker as close to the footer as possible, before </body>.

<div id="customize_box_detail"></div>
<script>
  var _cmq = _cmq || [];
  _cmq.push(['action', 'show']);
  _cmq.push(['box', 'BOX_ID']);
  _cmq.push(['web', 'YOUR_WEB']);
  _cmq.push(['elementid', 'customize_box_detail']);
  _cmq.push(['userid', '']);
  _cmq.push(['itemid', 'PRODUCT_ID']);
  _cmq.push(['exceptid', '']);
  _cmq.push(['process']);
</script>

<!-- Customize.cz tracking script -->
<script>
  var cm = document.createElement('script');
  cm.type = 'text/javascript';
  cm.async = true;
  cm.src = '//customize.cz/add/tracker.js';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(cm, s);
</script>

Conversion after an order

On the confirmation page, send the order number and, for each product, its ID, unit price including VAT and quantity. Repeat the itemid, price and quantity lines for every product in the order.

<script>
  var _cmq = _cmq || [];
  _cmq.push(['action', 'conversion']);
  _cmq.push(['web', 'YOUR_WEB']);
  _cmq.push(['transaction', 'ORDER_NUMBER']);
  _cmq.push(['userid', 'CUSTOMER_ID']);
  _cmq.push(['firstname', 'FIRST_NAME']);
  // for each product in the order:
  _cmq.push(['itemid', 'PRODUCT_ID']);
  _cmq.push(['price', 'UNIT_PRICE_WITH_VAT']);
  _cmq.push(['quantity', 'QUANTITY']);
  _cmq.push(['process']);
</script>
<!-- followed by the same tracker.js loader as above -->

Product feed

The product XML feed follows the Heureka structure: a SHOP root with SHOPITEM entries. It is imported regularly and the boxes select products from it.

FieldMeaning
ITEM_ID, PRODUCT, URL, IMGURLBasic product data: ID, name, product and image URL.
PRICE_VATPrice including VAT.
CAT1 to CAT4, PARAMCategories and product parameters.
PROFITABILITY, ACTION, BUYURL, DELIVERY_DATEOptional fields: profitability, promotion, add-to-basket URL and delivery time.
FIELD1 to FIELD15Optional custom fields; fields 13 to 15 carry a discount code.

Product feed documentation (PDF, 611 KB)

Availability feed

An optional feed that keeps prices and availability current so that sold-out items do not end up in the boxes. It contains ITEM_ID, PRODUCT, PRICE_VAT, PRICE_VAT_NORMAL and DELIVERY_DATE.

Availability feed documentation (PDF, 448 KB)

Transaction feed

An optional feed with order history that powers personalization based on past purchases and personalized e‑mail. The ORDERS root contains ORDER entries with ORDER_ID, ORDER_CREATED, PRODUCT_ID, PRODUCT_QUANTITY, PRODUCT_PRICE, USER_ID and USER_NAME. USER_ID is a hash of the customer's e‑mail.

Transaction feed documentation (PDF, 362 KB)

Box API

Use the Box API when you render recommendations yourself. It returns the list of boxes and the settings and products of a given box. API_KEY is your e‑shop's key.

GET /data/v1.2/API_KEY/box/list
GET /data/v1.2/API_KEY/box/get?box=BOX_NAME

Logger API

The Logger API accepts impression, click, add-to-basket and completed-order events from your own rendering. Both POST and GET are supported.

POST /data/v1.2/API_KEY/logger/show
POST /data/v1.2/API_KEY/logger/click
POST /data/v1.2/API_KEY/logger/buy
POST /data/v1.2/API_KEY/logger/conversion
ParameterMeaning
entityPage type: homepage, catalog, detail, basket, article or other.
entity_idID of the product whose page the event happened on (the order number for conversion).
place, place_idBox position and a unique ID of the particular impression that later events refer to.
recommended_id[]IDs of the recommended products (a single ID for click and buy).
url, session_idPage URL and the visitor's session ID, which links events to an order.
total_priceconversion only: total order price.

A successful call returns:

{"status": "ok"}

Customer deletion API (GDPR)

When a customer asks for erasure, call customerDelete. The call is protected by Basic authentication with your e‑shop's API credentials. The customer identifier is irreversibly anonymized. More about data processing in the Privacy policy.

POST /data/v1.2/API_KEY/customerDelete
Authorization: Basic USER:PASSWORD
customerId=CUSTOMER_ID

Security and operations

Transport and access

Communication runs over HTTPS and every client has its own API key.

Domains

CORS is restricted to the client's domains and click redirects work only for registered domains.

More answers are in the FAQ; for pricing see Pricing.

Need help with the integration?

Download the feed documentation or get in touch and we will arrange a technical consultation.