Support » Plugin: GTM4WP - A Google Tag Manager (GTM) plugin for WordPress » How can I add other (custom) product data to the DataLayer Push?

  • I am using the default Woocommerce integration of your plugin, which gives us these variables: id, name, price, category and quantity.

    Now I would like to add data like: brand, variant, coupon and ideally all other custom fields that we have added to the product. But I don’t know the exact array variable to add in the /integration/woocommerce.php file.

    I first tried something like this, without result
    "coupon" => $product_coupon

    Do you know of a list of default product data or post meta?

    https://wordpress.org/plugins/duracelltomi-google-tag-manager/

Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    I did not add brand since this is not a default feature of WooCommerce. There are some extra plugins which can add the ‘brand’ field to each product but I can not add support for all of them.

    Variation is on the list to be implemented but I did not had the time to examine the WooCommerce API. So actually I am looking for the answer to the same question as you: how 🙂 If you see any answer and you can add this feature to the plugin, I am open to include your enhancement labeling you as the contributor.

    Custom fields are also a question of ‘how’ – I mean I now how to access custom fields for products but those are usually stored as custom dimensions thus it would need a UI on the admin panel as well so that users could select which custom fields should map to which custom dimension index.

    Thomas

Viewing 1 replies (of 1 total)
  • The topic ‘How can I add other (custom) product data to the DataLayer Push?’ is closed to new replies.