For Developers
Filters
Section titled “Filters”wpify_woo_heureka_mereni_konverzi_url
Section titled “wpify_woo_heureka_mereni_konverzi_url”Modifies the URL of the Heureka tracking script.
add_filter( 'wpify_woo_heureka_mereni_konverzi_url', function( $url ) { // Custom script URL return $url;} );| Parameter | Type | Description |
|---|---|---|
$url | string | Script 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:
| Hook | Type | Description |
|---|---|---|
woocommerce_thankyou | Action | Renders tracking code on the thank you page |
wp_footer | Action | Renders tracking code on the product page |
Tracking Code Structure
Section titled “Tracking Code Structure”Thank You Page
Section titled “Thank You Page”On the thank you page, JavaScript is generated that:
- Loads the Heureka SDK
- Authenticates using the public key
- Sets the order ID
- Adds products (ID, name, price, quantity)
- Adds shipping and fees
- Sets the total price and currency
- Sends the data
Product Page
Section titled “Product Page”On the product page (is_product()), only the Heureka SDK is loaded for tracking product views.
Example Output Code
Section titled “Example Output Code”<!-- 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>