Skip to content

Automatic Setting of goalId to 0 in Presence of Ecommerce Parameters #162

@dheid

Description

@dheid

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions