Support » Plugin: Google Tag Manager for WordPress » Price not updating in variable products in WooCommerce

  • Hi Thomas,

    first of all thanks for this plugin!

    We are using it in combination with enhanced e-commerce tracking for WooCommerce. When we enable it we will get this information in the source code:

    <input type=”hidden” name=”gtm4wp_id” value=”20607″ />
    <input type=”hidden” name=”gtm4wp_name” value=”Product Name” />
    <input type=”hidden” name=”gtm4wp_sku” value=”20607″ />
    <input type=”hidden” name=”gtm4wp_category” value=”Product Cat” />
    <input type=”hidden” name=”gtm4wp_price” value=”19″ />
    <input type=”hidden” name=”gtm4wp_stocklevel” value=”” />

    This is good, but: the code above is not updating when either
    a) changing the variant size in the front-end or
    b) accessing a variant per URL directly (e.g. https://www.myshop.com/produkt/product-name/?attribute_groesse=15ml).
    Then it still shows the values of the lowest product (sku, price), in our case is shows a price of 19 Eur instead of the price of that specific variant.

    Can you check this?

    The issue we are facing is that Google Merchant Center won’t accept our product URLs with direct links to variants (?attribut_groesse) since Google tells us that the price differs from the price shown on the product page.

    Thanks!

    • This topic was modified 2 months, 1 week ago by flymke.
Viewing 1 replies (of 1 total)
  • Plugin Author Thomas Geiger

    (@duracelltomi)

    Hi,

    Google Merchant Center is not reading those input values while checking the price. What they are doing is to read the corresponding schema.org markup on your page.

    What you could do is to use this tool, enter the URL of your product page with a variant pre-selected and see what the site is telling about the price:
    https://search.google.com/structured-data/testing-tool

    It should be one specific price, the one that is set to your variant product.

    GTM4WP is only using those input values initially to set proper ecommerce actions. After this, JavaScript variables hold the correct value which is read during attribute selection so if you see that those input values do not update, then this is the expected behavior.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.