• Hi,

    i can’t seem to figure out how to add custom productdata to the datalayer, for example the value of a custom field which is added to woocommerce products?

    I saw this thread: https://wordpress.org/support/topic/adding-custom-variable-to-product-information/

    which adds ecommerce.detail.products.0.metric1 with a value of 0, so that works.

    but how can i use this function to add the value from a product’s custom field? For example, when there is a custom field “customprice” with a value of 15, then something like this will be added to the datalayer for that product:

    ecommerce.detail.products.0.customprice with a value of 15

    Thanks!

The topic ‘Adding custom product data to datalayer’ is closed to new replies.