Floating-Dartists / matomo-tracker

A fully cross-platform wrap of the Matomo tracking client for Flutter, using the Matomo API.
https://pub.dev/packages/matomo_tracker
MIT License
26 stars 28 forks source link

Add grandTotal/revenue to trackCartUpdate #138

Closed CleverUnderDog closed 8 months ago

CleverUnderDog commented 8 months ago

According to Matomo documentation we need to track the total revenue with trackEcommerceCartUpdate (Docs).

I also checked the source code for Matomo's js tracker and found that the beforehand mentioned functionality results in revenue parameter being set (here and here).

The following code results in a empty revenue cart in Matomo:

MatomoTracker.instance.trackCartUpdate(
    trackingOrderItems: cartState.items.values
        .map((e) => TrackingOrderItem(
            sku: e.uuid,
            name: e.offeringItem.item.getName(),
            price: e.offeringItem.price / 100.0,
            quantity: e.amount))
        .toList(),
    grandTotal: total);

Matomo Screenshot: Screenshot 2024-02-20 at 16 35 41

CleverUnderDog commented 8 months ago

@TesteurManiak How does the release process work for this project? As of now I am using a git reference for my project but would be nice to use a official version.

TesteurManiak commented 8 months ago

Considering that there was some breaking changes we'll have to publish the next version under the label v5, I'd like to properly remove the support for Matomo 3 before publishing it (and maybe beforehand merging #135)