Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add grandTotal/revenue to trackCartUpdate #138

Merged
merged 3 commits into from
Feb 20, 2024

Conversation

CleverUnderDog
Copy link
Contributor

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

Copy link
Member

@TesteurManiak TesteurManiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TesteurManiak TesteurManiak merged commit 8792b7b into Floating-Dartists:main Feb 20, 2024
2 checks passed
@CleverUnderDog
Copy link
Contributor Author

@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
Copy link
Member

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)

Copy link
Member

@Pierre-Monier Pierre-Monier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants