Firebase Best Practices: keeping Google BigQuery Costs Down

We specifically designed AdLibertas to use the Google batch export feature — which is currently free.

But your own data costs, if not properly managed, can become significant and will scale with time. So here are some tips to keep your Google BigQuery costs down.

Related: Connecting Firebase to AdLibertas Audience Reporting

Disable Data Streaming Inserts – in December of 2020 Firebase started real-time streaming into BigQuery by default to enable up-to-date data. However, this will increase the price significantly and it may be unnecessary for most AdLibertas customers. To disable streaming events:

  1. Login to your Firebase Console.

  2. Go to project settings > integrations > Google Analytics Manage

  3. Open the Linked Google Analytics account which should take you to the Google Analytics admin dashboard.

  4. Click BigQuery Linking under the Product Linking section for the linked Google Analytics property

  5. Select the Firebase project ID from the list.

  6. Disable the Streaming checkbox and then click Save (button in the upper right).

Setting Table Expiration – Once the BigQuery integration is enabled for Firebase projects with a paid plan, Google creates a new dataset that will incur an ongoing storage cost. AdLibertas will import and save new data as it is made available.

We recommend setting a default table expiration time of at least 60 days to keep the storage costs down. This is so Google has enough time to finalize and send all event data to BigQuery before expiring the table. To enable a default table expiration time:

Note, you’ll need to repeat these instructions for each Firebase project on a paid plan.

  1. Visit your BigQuery console

  2. In the Resources pane, select your dataset.

  3. On the Details page, click the pencil icon next to Dataset info to edit the expiration.

  4. In the Dataset info dialog, in the Default table expiration section, enter a value for the Number of days after table creation.

  5. Click Save.

Reducing Unnecessary Events – Reducing the number of user events has an important factor in data-set size, overhead — and cost. Therefore we recommend periodically auditing your user events and disabling/ deleting the unnecessary or non-valuable user events.

For example, Google automatically logs an event “screen_view” automatically for each screen a user sees. For apps with a high amount of screen views, this could be an unnecessary burden. See this article for manually tracking screen views.

Note: reducing events will impact the accuracy of other measurements. For example, the user’s time in the app is measured by adding up milliseconds between each event. Filtering or deleting events will reduce the time measured by these missing events.

Related reading:

Last updated