• Hi,

    First as all, Thanks for developing great plugin!

    Plugin is working well.

    and i have a question about add_to_wishlist event.

    I am using TI WooCommerce Wishlist.

    when i click the wishlist button loaded by this plugin, the “tinvwl_add_to_wishlist_button” class will occur.

    I can track wishlist event by specifying classes by link-click in tag manager, but I don’t know how to integrate with WooCommerce and GTM4WP.

    I tried to add “add_to_wishlist” event in custom event like below.

    view_item|view_item_list|select_item|add_to_cart|remove_from_cart|view_cart|begin_checkout|add_payment_info|add_shipping_info|purchase|add_to_wishlist

    And made variable as Ecommerce wishlist then put {{ecommerce wishlist}} in GA4 – Event – Ecommerce events tag.

    But not working.

    Could you give me some advice on what to do?

    thank you.

    • This topic was modified 3 years, 1 month ago by cheonmu.
Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    This is more complicated than that.

    On product detail pages the necessary product data is added to the add to cart form. In order to track the add_to_wishlist event, you will need to read the values with custom JS codes and build the required ecommerce data layer

    <input type="hidden" name="gtm4wp_id" value="31" />
    <input type="hidden" name="gtm4wp_name" value="Hoodie with Logo" />
    <input type="hidden" name="gtm4wp_sku" value="Hoodie_Logo_SKU" />
    <input type="hidden" name="gtm4wp_category" value="A subcategory" />
    <input type="hidden" name="gtm4wp_price" value="45" />
    <input type="hidden" name="gtm4wp_stocklevel" value="" />
    <input type="hidden" name="gtm4wp_brand" value="Shiny Brand" />

    It is even more complicated if the product is a variable product, in that case some additional JS code might be needed to get what product variation was added to the wishlist.

Viewing 1 replies (of 1 total)
  • The topic ‘About add_to_wishlist event’ is closed to new replies.