Skip to content

For Developers

Modifies the URL of the Heureka tracking script.

add_filter( 'wpify_woo_heureka_mereni_konverzi_url', function( $url ) {
// Custom script URL
return $url;
} );
ParameterTypeDescription
$urlstringScript URL (e.g., //www.heureka.cz/ocm/sdk.js?version=2&page=thank_you)

Returns: string

Default values:

  • CZ thank you page: //www.heureka.cz/ocm/sdk.js?version=2&page=thank_you
  • SK thank you page: //www.heureka.sk/ocm/sdk.js?version=2&page=thank_you
  • CZ product detail: //www.heureka.cz/ocm/sdk.js?version=2&page=product_detail
  • SK product detail: //www.heureka.sk/ocm/sdk.js?version=2&page=product_detail

The module uses the following WordPress/WooCommerce hooks:

HookTypeDescription
woocommerce_thankyouActionRenders tracking code on the thank you page
wp_footerActionRenders tracking code on the product page

On the thank you page, JavaScript is generated that:

  1. Loads the Heureka SDK
  2. Authenticates using the public key
  3. Sets the order ID
  4. Adds products (ID, name, price, quantity)
  5. Adds shipping and fees
  6. Sets the total price and currency
  7. Sends the data

On the product page (is_product()), only the Heureka SDK is loaded for tracking product views.

<!-- Heureka.cz THANK YOU PAGE script -->
<script>
(function (t, r, a, c, k, i, n, g) {
// ... loader code
})(window, document, 'script', '//www.heureka.cz/ocm/sdk.js?version=2&page=thank_you', 'heureka', 'cz');
heureka('authenticate', 'YOUR_PUBLIC_KEY');
heureka('set_order_id', '123');
heureka('add_product', '456', 'Product Name', '999', '1');
heureka('add_additional_item', 'Shipping', '99', '1');
heureka('set_total_vat', '1098');
heureka('set_currency', 'CZK');
heureka('send', 'Order');
</script>