Skip to content

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

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

Closed
dheid opened this issue Nov 14, 2023 · 0 comments
Closed

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

dheid opened this issue Nov 14, 2023 · 0 comments
Assignees

Comments

@dheid
Copy link
Contributor

dheid commented Nov 14, 2023

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant