Question: What's the preferred approach to log e-commerce events?
mariusbolik opened this issue · 5 comments
Hello,
thank you for this helpful plugin!
Is it possible to measure e-commerce events exactly like mentioned here: https://firebase.google.com/docs/analytics/measure-ecommerce
Should I simply use logEvent method or is there any other preferred approach?
Regards,
Marius
Hi Marius Bolik,
Did you got the way how to log E-commerce events as per given document. I have logged the events with log event function but Ecommerce object is not getting passed it shows Firebase error 20 how can overcome this issue. please let me know it will very appreciated.
Regards,
Niraj Parte
Hi Niraj,
I ended up using the plugin capacitor-firebase/analytics by @robingenz.
It seems way better maintained than the community plugin.
Regards,
Marius
Thank you Marius,
Just one doubt can we pass "ecommerce" object inside params object.
can you give me any example code how to log ecommerce event that will be very helpful.
Regards,
Niraj Parte
Hi Niraj,
Example:
await FirebaseAnalytics.logEvent({
name: 'purchase',
params: {
currency: 'USD',
transaction_id: 'XYZ',
value: 12.34
}
});
Here you can find event names and params: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?hl=en&client_type=gtag