matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
388 stars 164 forks source link

Goals revenue value missing #414

Closed Hunt3rDe closed 2 years ago

Hunt3rDe commented 2 years ago

Hello Devs of MatomoTracker, I'm using the SDK to track many things in the app and it works great, so thanks a lot for this tool. But since I've increased the sdk version from 7.4.1 to 7.5.1 the tracking of revenue on goal goes broken. The goals tracking is still working, but without the revenue value. So I decide to test this case precisely, and downgraded the sdk version back to 7.4.1 and ta-da, it works again... To be more precisely, the bug seems to be already in the sdk version 7.5, because after increasing the sdk version to the 7.5 my matomo server didn't receive any revenue values anymore, but still receive goals.

I'm using the MatomoTracker method: public func trackGoal(id goalId: Int?, revenue: Float?) to track the goals and the revenue value.

I've searched already for changes between the version 7.4.1 and 7.5 but I didn't found any significant changes. Maybe did you have any idea what goes wrong?

Thanks

brototyp commented 2 years ago

Hi @Hunt3rDe, thanks a lot for the research you put into writing this bug report. Looking at the diff, the only thing that comes to mind that could affect this is this line.

Since the revenue can be tracked via a goal or via an order, the latter one did override the revenue of the goal with nil.

brototyp commented 2 years ago

Can you checkout #415? That should fix the issue.

Hunt3rDe commented 2 years ago

Hello @brototyp, thanks a lot for fast error finding and fixing. I've already tested your fix, and it works great for me. The matomo server did receive the revenue.

What do you think, how fast it will be merged into develop ? and how fast it will be available as new version ?

Thanks.

brototyp commented 2 years ago

Hey @Hunt3rDe, it took a bit longer but I just released this in version 7.5.2.

Hunt3rDe commented 2 years ago

Thank you @brototyp 👍