Hooks

Hooks give you the ability to use the plugin’s functionality in your own code.

For instance, not all themes follow WooCommerce conventions. In this case, you can use hooks like the pmw_print_product_data_layer_script_by_product hook to add the product details to the data layer.

Add product details to the data layer

↑ Back to top

This hook adds the product details to the Pixel Manager data layer. Use it in your product template file.

This architecture is useful because it allows the product details in the data layer to be added only when the product is displayed and works very well with caching plugins.

product-template.php

do_action('pmw_print_product_data_layer_script_by_product', PRODUCT_OBJECT);
product-template.php

do_action('pmw_print_product_data_layer_script_by_product_id', YOUR_PRODUCT_ID);
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.