Missing transactions in Google Analytics
-
Hello!
The last few months we face a problem with our Google Analytics revenue; it doesn’t match with our Woocommerce sales report.
So we started to check frequently the last 2-3 weeks and noticed that from 25 sales made with Woocommerce, 10 of them didn’t show up in our Google Analytics console.
We thoroughly checked these 10 orders and didn’t find any common element between them.
More specifically we didn’t find any pattern such as the payment method (cash on delivery, pay with credit card etc), the shipping cost or method, the date or time, the total cost or any other order feature that could be the same in all of these orders and cause the problem.The browsers used by the customers where also various.
Could you direct us to what might be at fault for our missing transactions in Google Analytics?
Please note that the “Enable Enhanced eCommerce” is NOT checked in the plugin settings and instead we use the following code in theme’s functions.php
<?php /*********** Google Conversion Tracking ************/ function google_conversion_tracking() { ?> <!-- Global site tag (gtag.js) - Google Ads: ********* --> <script async src=https://www.googletagmanager.com/gtag/js?id=AW-***********></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-***********'); </script> <?php } add_action('wp_head', 'google_conversion_tracking'); ?> <?php add_action( 'wp_head', function(){ ?> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-*******');</script> <!-- End Google Tag Manager --> <?php }); ?> <?php add_action('wp_body_open', function(){ ?> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-*******" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <?php }); ?> <?php add_action('woocommerce_thankyou','add_purchase_conversion_tracking'); function add_purchase_conversion_tracking($order_id) { if (!$order_id) return; $order = wc_get_order($order_id); if ($order) { $order_total = $order->get_total(); ?> <!-- Event snippet for Product Purchase conversion page --> <script>gtag('event', 'conversion', { 'send_to': 'AW-***********/********************', 'value': '<?= $order_total ?>', 'currency': 'EUR', 'transaction_id': ''}); </script> <?php } } ?> <?php add_action( 'wp_enqueue_scripts', 'bbloomer_disable_woocommerce_cart_fragments', 11 ); function bbloomer_disable_woocommerce_cart_fragments() { wp_dequeue_script( 'wc-cart-fragments' ); } ?>
- The topic ‘Missing transactions in Google Analytics’ is closed to new replies.