Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Missing Events in Google Analytics triggers Towards Cloud Functions (1st Gen)

We have deployed this functionality in our firebase ecosystem. The events are marked for conversion & we see that setup is working. However, we have noticed that post reconciliation of the events real time events (from Cloud Trigger) vis-a-vis BigQuery - the numbers dont seem to match. We understand the feature itself is in preview - but seems we are missing 1/3 events when it comes to real time triggers.

We have done extensive investigation into the Cloud Function Logs & there are indeed missing ga_session_id's which are logged to bigquery but never hit the cloud function itself.

Did anyone face this issue ?

1 3 1,212
3 REPLIES 3

It's possible that you're experiencing a delay in the delivery of events from Google Analytics to Cloud Functions due to the Google Analytics for Firebase trigger still being in preview. As such, events may be delayed.

Potential reasons for missing events include:

  • Event Processing Time: Google Analytics might still be processing some events, causing a delay in their delivery to Cloud Functions.
  • Cloud Functions Configuration: Ensure your Cloud Functions trigger is correctly set up, and the function is deployed and operational.
  • Network Issues: Ensure there's a stable internet connection when events are being transmitted.

To troubleshoot:

  • Cloud Functions Logs: Review these logs to ensure your function is receiving and processing events without errors.
  • Google Analytics Event Logs: Confirm events are being logged and marked as conversion events in Google Analytics.
  • Cloud Logging: Use Cloud Logging to monitor your Cloud Functions' activity and identify any potential issues.

Additionally:

  • Retries: Consider increasing the number of retries for your Cloud Functions trigger to handle transient delivery issues.
  • Alternative Delivery Mechanisms: If you're looking for more reliability, consider using a service like Pub/Sub, though this might require changes to your current setup.

Thanks @ms4446 for your reply.

Just a few more pointers for this issue :

1. We have waited for almost 7 days for the missing events to appear - so prima facie does not seem to be a case of delayed delivery.

2. Is there any possibility - that as a end user - we can check these logs - providers/google.firebase.analytics/eventTypes/event.log (LINK).

3. Could this be a case for not having google cloud functions min instances warm enough (Currently we are using 0 warm instances - we have increase it to 5). If this could be a scenario - where can we possibly check cloud functions running out of instances to run the function ?

You could be experiencing a high number of missing real-time events from Google Analytics to Cloud Functions due to a number of factors, including:

  • A delay in Google Analytics processing events. While it is possible for events to be delayed for a short period of time, a 7-day delay is highly unusual and indicates a more significant issue.
  • A problem with the Cloud Functions trigger. Make sure that your trigger is configured correctly and that your function is deployed and running.
  • A problem with your network connection. Make sure that your app and Cloud Functions are on the same network and that there is no interference with your network connection.
  • Cloud Functions min instances not warm enough. Cloud Functions will scale down to zero instances when there is no traffic,and then scale up again when traffic increases. If you have a lot of traffic spikes, then your Cloud Functions instances may not have enough time to warm up before they are needed to process events.

Troubleshooting

To troubleshoot the issue, you can try the following:

  • Check the Cloud Functions logs.Make sure that your function is receiving events and that it is not failing to process them.
  • Check the Google Analytics event logs. Make sure that the events are being logged to Google Analytics and that they are being marked as conversion events.
  • Use Cloud Logging to monitor the delivery of events from Google Analytics to Cloud Functions. This can help you to identify any delays or problems with the delivery process.
  • Increase the number of warm instances for your Cloud Functions function. This will help to ensure that there are always enough instances available to process events.

Additional tips:

  • Using a caching layer in front of Cloud Functions is not typically recommended for troubleshooting real-time event delivery issues.
  • Switching to Pub/Sub is a more extensive architectural change, and should only be considered if there is a specific need.