Skip to content
You are here:

Firebase Best Practices: keeping Google BigQuery Costs Down

Data costs can become significant and will scale with time. Here are some tips to keep your BigQuery costs low.

Related: Connecting Firebase to AdLibertas Audience Reporting

Disable Data Streaming Inserts – in December of 2020 Firebase started realtime streaming into BigQuery by default to enable up-to-date data. However this will increase price significantly and may be unnecessary for most 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. In 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 Number of days after table creation.
  5. Click Save.

Reducing Unnecessary Events – Reducing the number of user events has an important factor on data-set size, overhead — and cost. Therefore we recommend periodically auditing your user events and disabling/delete 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.

Table of Contents