具有云功能的 Firebase 分析日志事件 [英] Firebase analytics log events with cloud functions

查看:19
本文介绍了具有云功能的 Firebase 分析日志事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm using google cloud functions as backend to process my app orders and connect with gateway payment to accept/deny purchases...

Everything is working fine. but i would like to register the purchase events to firebase analytics so i can monitore all app revenue in the same dashboard in firebase

on android I can do something like:

Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, id);
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, name);
bundle.putString(FirebaseAnalytics.Param.VALUE, value);
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.PURCHASE, bundle);

then it will appears in my dashboard... the problem is i want to register this event ONLY WHEN the user paid for the purchase, so it can be done from the app, it must be set after the payment gateway returns to my backend with the payment status

I'm using google cloud functions with node js as backend and i would like to know how can i register an firebase analytics event from there

解决方案

There is no SDK to send events to Google Analytics for Firebase from Node.js/Cloud Functions. The only way I can see is to export your Firebase Analytics to BigQuery, and then write to BigQuery from Cloud Functions too. Then you can perform queries on the combined data in BigQuery.

Also see:

这篇关于具有云功能的 Firebase 分析日志事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆