2
votes

Since our upgrade to GA universal we have been missing some of our transactions. About 5-10 a day, which accounts to < 5% of all transactions.

Below is the code that is on our confirmation page and is wrapped in a document ready function. Within our review order page, I have a GA event that tracks the "Place Order" button click. We are tracking 100% of these events. The checkoutoutcomplete event is fairs a little better than our transaction counts. Meaning if we have 100 place order click events showing in GA. I would see 95 transactions and 96 checkoutoutcomplete events.

It's possible there are other forces at play here that have not exposed themselves yet. Testing with large orders and in our dev enviroment works every time of course. I've tried wrapping the entire GA code in a try catch with logging, which resulted in no errors being captured.

Has anyone else experienced issues like this with missing revenue? Suggestions and comments welcome.

            $.each(cartItems, function (key, value) {

                ga('ec:addProduct', {
                    'id': this.StyleNumber.toUpperCase(),           // Product ID
                    'name': this.StyleNumber.toUpperCase(),         // Product name. Required.
                    'sku': this.SkuNumber,                          // SKU/code.
                    'brand': this.Brand,                            // Category or variation.
                    'price': this.Price,                            // Unit price.
                    'quantity': this.Qty                            // Quantity.
                });
            });

            ga('ec:setAction', 'purchase', {  // Transaction details are provided in an actionFieldObject.
                'id': invoiceNumber,          // (Required) Transaction id (string).
                'affiliation': 'COS',         // Affiliation (string).
                'revenue': amount,            // Revenue (currency).
                'tax': taxAmount,             // Tax (currency).
                'shipping': shipAmount,       // Shipping (currency).
                'coupon': coupon              // Transaction coupon (string).
            });

            ga('send', 'event', 'Checkout', 'Checkoutcomplete');
1
Are the types of variables always correct? If one of them is not correct the transaction won't be sendVitor Capretz
In another version, I performed checks to make sure nothing was null or an empty string. Had no luck with that either. I have not checked types so that is something I can do.Robert
If you send a string instead of number for example, it won't be send either. Check the types, might helpVitor Capretz

1 Answers

1
votes

Turns out this is a limit in GA. You can only send about 80KB per call. As this site is a B2B which has very large carts.

Google Analytics error in ga("send", "pageview") on certain pages