问题描述
我开始为Android应用程序使用Firebase Cloud Messaging,现在我正尝试将Google Analytics(而非Firebase Analytics)添加到同一应用程序.
I started using Firebase Cloud Messaging for an Android app and now I'm trying to add Google Analytics (not Firebase analytics) to the same app.
问题在于,当为Analytics创建google-services.json时,它将忽略FCM.我正在使用相同的Google帐户来创建两个json文件.
The problem is that when creating google-services.json for Analytics, it ignores FCM. I'm using the same google account to create both json files.
我读到,启用第二项服务(在本例中为Analytics)时,json应该更新以添加消息传递和Analytics(分析),但这也许仅在Firebase服务中有效吗?
I read that when enabling the second service (in this case Analytics) the json should update adding both Messaging and Analytics but maybe this only works within Firebase services?
我可以使用Firebase Analytics,这实际上是Google的建议,但是可以同时使用Google Analytics和Firebase服务吗?
I could use Firebase Analytics and actually that's what Google recommends, but is it possible to use both Google Analytics with Firebase services?
推荐答案
是的,可以在同一应用程序中使用Firebase Cloud Messaging和Google Analytics(分析).我建议使用Firebase生成的json文件,并将以下对象合并到服务"对象中:
Yes, it is possible to use Firebase Cloud Messaging and Google Analytics in the same app. I would suggest using the json file generated by Firebase and merging in the following object into the "services" object :
"analytics_service": {
"status": 2,
"analytics_property": {
"tracking_id": "<your tracking id>"
}
},
这篇关于是否可以在Android的Google Analytics(分析)中使用Firebase Messaging?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!