• When the “Purchase” events fires (thankyou page after you make an order)

    And you use a coupon (smart coupons) the gives you the order for free.

    so technically the price is 0

    then the price in the data layer is undefined which gives us problems with GTM

    example:

    {
    "event": "purchase",
    "ecommerce": {
    "currency": "EUR",
    "items": [
    {
    "item_id": "43534534534543543",
    "item_name": "Kerstlampjes (20 LED lampjes)",
    "item_brand": "Kerstcollectie",
    "price": ,
    "item_category": "Decoratie",
    "quantity": 1,
    "google_business_vertical": "retail",
    "id": "43534534534543543"
    }
    ],
    "transaction_id": "435345345",
    "affiliation": "",
    "value": 0,
    "tax": 0,
    "shipping": 0,
    "coupon": "somecouponthatgivesmethatorderforfree"
    }
    }

    What i did to solvew it for now but is not really prefered as it is hardcoded fix.

    gtm4wp-woocommerce-enhanced.js // line 24

    'price': productdata.price ? productdata.price : ""

    versus

    'price': productdata.price ? productdata.price : "0.00"

    Now it solves our problem

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Price is undefined’ is closed to new replies.