woocommerce / woocommerce-google-analytics-integration

WordPress plugin: Provides the integration between WooCommerce and Google Analytics.
http://wordpress.org/plugins/woocommerce-google-analytics-integration/
170 stars 69 forks source link

Item Revenue data sent to Google Analytics uses Product Price, not Order Item Total #417

Closed chvillanuevap closed 4 months ago

chvillanuevap commented 4 months ago

Describe the bug:

There is a discrepancy between the Revenue reported in WooCommerce and the Total Item Revenue shown in Google Analytics 4 (GA4) under "Monetization" >> "Ecommerce purchases". The discrepancy originates from the plugin sending the regular price of a product to Google Analytics, rather than the item total as displayed in the order. For example, in a recent order, the customer purchased an art kit priced at $125 and added an online art course regularly priced at $45. However, since the customer used a coupon code, the item total for the course was $0:

Screen Shot 2024-05-07 at 11 39 51 PM

Yet, in GA4, the course appears with its regular price, leading to a discrepancy in total item revenue reporting.

Screen Shot 2024-05-07 at 11 52 58 PM Screen Shot 2024-05-07 at 11 41 23 PM

Steps to reproduce:

  1. Complete an order with multiple items where at least one item is discounted from the regular price through a coupon or other promotional adjustments.
  2. Check the item revenue in GA4 and compare it with the WooCommerce order summary.

Expected behavior:

The item revenue in GA4 should reflect the actual amount paid as shown in the WooCommerce order summary, accounting for any discounts applied.

Actual behavior:

The plugin is incorrectly sending the regular product price to GA4, rather than the discounted total shown on the order. This results in inflated revenue figures in GA4 that do not match the actual store revenue.

ianlin commented 4 months ago

Thanks for reporting this, I can reproduce this behaviour. I'm start looking into fixing this.