Currently, in the MatomoRequest Java class, users need to manually set the goalId parameter. However, if any ecommerce parameter is set without updating the goalId accordingly, it results in an exception on validation. To prevent such mistakes and enhance user experience, this enhancement request proposes automatic setting of the goalId to 0 when any ecommerce parameter is detected.
Expected Behavior
When any ecommerce parameter (ecommerceRevenue, ecommerceItems, ecommerceSubtotal, ecommerceTax, ecommerceShippingCost, ecommerceDiscount, ecommerceLastOrderTimestamp) is set, the MatomoRequest class should automatically set the goalId to 0.
Use Case
This enhancement is essential for scenarios where ecommerce data is being tracked. Automatic adjustment of the goalId ensures consistent and accurate representation of data in analytics.
Implementation Suggestion
Add a conditional check in the MatomoRequest class to automatically detect the presence of any ecommerce-related parameters. If such parameters are present, set the goalId to 0.
Additional Information
This enhancement aligns with best practices in analytics tracking when dealing with ecommerce data.
Ensures a smoother user experience by eliminating the need for manual intervention in setting goalId in ecommerce scenarios.
Acceptance Criteria
When any ecommerce parameter is set, the goalId should be automatically set to 0.
The modification should not interfere with existing functionality and should be backward compatible.
Currently, in the
MatomoRequest
Java class, users need to manually set thegoalId
parameter. However, if any ecommerce parameter is set without updating thegoalId
accordingly, it results in an exception on validation. To prevent such mistakes and enhance user experience, this enhancement request proposes automatic setting of thegoalId
to 0 when any ecommerce parameter is detected.Expected Behavior
When any ecommerce parameter (
ecommerceRevenue
,ecommerceItems
,ecommerceSubtotal
,ecommerceTax
,ecommerceShippingCost
,ecommerceDiscount
,ecommerceLastOrderTimestamp
) is set, theMatomoRequest
class should automatically set thegoalId
to 0.Use Case
This enhancement is essential for scenarios where ecommerce data is being tracked. Automatic adjustment of the
goalId
ensures consistent and accurate representation of data in analytics.Implementation Suggestion
Add a conditional check in the
MatomoRequest
class to automatically detect the presence of any ecommerce-related parameters. If such parameters are present, set thegoalId
to 0.Additional Information
goalId
in ecommerce scenarios.Acceptance Criteria
goalId
should be automatically set to 0.