Closed Romanavr closed 1 year ago
We think we may have tracked down what's going on here.
Check out version 4.0.0-beta.3 -> https://github.com/nystudio107/craft-instantanalytics-ga4/releases/tag/4.0.0-beta.3
...and the docs changes/additions -> https://nystudio107.com/docs/instant-analytics-ga4/using.html#craft-commerce-tracking-with-google-enhanced-ecommerce
Is your feature request related to a problem? Please describe.
My feature request is based on this issuehttps://github.com/nystudio107/craft-instantanalytics-ga4/issues/6. After some research in the GA4 docs and in your plugin, I found that we're not sending the userId in any way, so I think that's the main problem. Even if not, it would still be good to send the userId.
Describe the solution you would like
I guess we can add it in src/ga4/Analytics.php and as a user id value: if the user is logged in, the user id, if not and it's an anonymous order, use the short order number (to avoid conflict with user and order id), for example:
Describe alternatives you have considered
I don't see any alternatives here. Maybe you can suggest, @khalwat ?
Additional context
https://support.google.com/analytics/answer/9213390 https://support.google.com/analytics/answer/9355972?hl=en