SpudCentric
SpudCentric

Reputation: 15

GA4 Ecommerce purchase event only displaying quantity of 1

Any help would be appreciated. We set up a GA4 purchase event on our site. Data is firing through to GA4 and product info visible in debug, when multiple items are purchased. Data layer is as follows;

'''    transaction_id: "XXXXXXX",
            value: "XX.XX",
            tax: "XX.XX",
            shipping: "0.00",
            currency: "GBP",
            items: [
                {
                    "item_id": "XXXX",
                    "item_name": "Product_Name_1",
                    "coupon": "",
                    "discount": "XX",
                    "item_brand": "XXX",
                    "item_category": "Example",
                    "item_category2": "Example_2",
                    "item_category3": "Example_3",
                    "price": "XX.XX",
                    "quantity": "5.00",
                    "line_price": "XX.XX"

'''

However in the GA4 debug mode while it does show the product and the details, quantity is showing as 1 and I don't know why.

Also, I'm not sure how our developer conducted the install, but as soon as enter the standard DLV parameters as part of the purchase event, the items stop being passed into GA4 nor are they visible in debug!

Upvotes: 0

Views: 121

Answers (1)

Cédric Boivin
Cédric Boivin

Reputation: 11361

Have you try to pass your amount and quantity in "double" not in string by removing the " in the json for amount, tax, and qty ?

transaction_id: "XXXXXXX",
            value: "XX.XX",
            tax: XX.XX,
            shipping: 0.00,
            currency: "GBP",
            items: [
                {
                    "item_id": "XXXX",
                    "item_name": "Product_Name_1",
                    "coupon": "",
                    "discount": XX,
                    "item_brand": "XXX",
                    "item_category": "Example",
                    "item_category2": "Example_2",
                    "item_category3": "Example_3",
                    "price": XX.XX,
                    "quantity": 5.00,
                    "line_price": XX.XX

Upvotes: 0

Related Questions