我正在尝试为Swift iOS应用实施Firebase Analytics。您能否解释一下是否可以通过预定义的AnalyticsEvent(如AnalyticsEventEcommercePurchase https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Constants#analyticseventecommercepurchase)传递自定义参数?
为了即时起见,我想在该事件中添加“ dicount_amount”,“ delivery_type”。AnalyticsEventEcommercePurchase是否有可能?
另外,是否可以在购买的每个商品的参数中添加“商品”数组?是否可以通过自定义事件传递预定义的参数?例如,将AnalyticsParameterItemId传递给我自己的事件view_product?
非常感谢。我将不胜感激任何建议和示例。
您可以。只需将它们与预定义参数一起传递,如下所示:
Analytics.logEvent(AnalyticsEventEcommercePurchase, parameters: [
AnalyticsParameterCurrency: "aud",
AnalyticsParameterValue: "999",
"whatever_you_want": "foo"
])
您也可以在自定义事件中使用预定义的参数,因为它们只是字符串。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句