matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.72k stars 2.63k forks source link

Ecommerce Reporting: Support Metrics and Dimensions from GA4 #21703

Open mattab opened 9 months ago

mattab commented 9 months ago

Summary: With the evolution of Google Analytics 4 (GA4), new ecommerce dimensions and metrics have been introduced, enhancing the capabilities of custom report building for ecommerce analytics. To keep Matomo competitive and offer our users the best possible analytics experience, it's vital for us to integrate these GA4 ecommerce features.

Proposed Features: We aim to support the following GA4 ecommerce dimensions and metrics in Matomo:

Ecommerce Dimensions:

Ecommerce Metrics:

The integration of these dimensions and metrics in custom reports, and the availability of new "standard" Reports for these dimensions and metrics, would make our platform more robust and useful for ecommerce businesses.

peterbo commented 9 months ago

Additionally, sorry for hi-jacking this ticket, the following metrics would be great to add to the "wishlist":

And also a thing, that makes replacing GA4 with Matomo extremely hard: The add to cart mechanic. While GA4 only requires to send only the added/changed product, that was added to the /changed within the cart, to the tracking, Matomo requires to always send all products (also the products, that are already in the cart). This should be optional, e.g. differentiate between setEcommerceItems, addEcommerceItem, removeEcommerceItem. In the end, trackEcommerceCartUpdate should not require to push all cart items to Matomo.

Glisse1 commented 8 months ago

Yes, i tried for 6-7 hours tonight and after 100 pages on the internet and tens of code snippets tried i stumbled upon this ticket. Sorry if it is inappropriate, you can delete it after reading. I have woocomerce+matomo and ecommerce tracking is prety much a nightmare compared to google. So much PHP code if you want it to make it work manually, to get sku s and prices and etc. I managed to make it work even tho I am not a programmer when it comes to tracking the orders completely and partially when it comes to cart updates, placing the code in footer (so it gets triggered on everypage). I am not that tech savy to make php codes work only on some ajax buttons to add or remove products, which I think would solve the problems.

My issue is with cart updates, which are ajax-triggered. For example If I add 5 products 2 $ each my code is working fine, the visit is registered with 5 products and 10 $ in abandonedCart. If i delete 4 products, again it is working fine, the abandoned cart is updated to just 1 product and 2 $, and as long as the cart value is bigger than 0, everything is updating correctly.

BUT, here is my problem. If I also delete the last product, and have 0 products in cart then this is not updating. The visitor remains forever with "abandonedCart" with 2 $, which is false, and only when again cart value is >0 is updating with the new items and values.

The problem is with trackEcommerceCartUpdate, that it NEEDS to have a value, grandtotal. If I call this function when the customer removes the last product from the cart it is working fine and updates to an "abandonedCart" with value 0 $. I dont see the logic in that, having abandonedCarts that are empty, but that would have still been fine and still a valuable metric. I learn that the customers at least had some items and removed them, and I could re-engage with them because I have their info from wordpress accounts.

But calling that trackEcommerceCartUpdate when the cart value is 0 (exactly the situation when products are removed and reach 0 value) turns every single visit into ones with abandonedCart, value 0.

So I preffer to have fake carts that maybe were deleted or maybe not, than to have all visits with abandoned carts.