title: Firebase analytics log events with cloud functions
body: <p>I'm using google cloud functions as backend to process my app orders and connect with gateway payment to accept/deny purchases...</p>
  
  <p>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</p>
  
  <p>on android I can do something like:</p>
  
  <pre><code>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);
  </code></pre>
  
  <p>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</p>
  
  <p>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</p>