mparticle-integrations / mparticle-javascript-integration-google-analytics-4

1 stars 4 forks source link

feat: Implement GA.Value custom flag, update tests #7

Closed rmi22186 closed 2 years ago

rmi22186 commented 2 years ago

Summary

GA4 introduces a new parameter called value in several of its event types. Given that value is used for conversion events, and given "value" means different things to companies (does it include discount, shipping, tax?), we should ask the customer to provide this as a custom flag GA4.Value . We thought about providing a default value calculation, but we’d have to explain that in docs, and we as an API should be agnostic in terms of what value is.

Refund and Purchase events continue to use "Total Amount" as the value in line with UA. If the user passes in "GA4.Value", this will override the "Total Amount" and be used for the value.

rmi22186 commented 2 years ago

Rebased locally and had to force push.