# Firebase

Send verified purchase events from Aplyna to Google Analytics for Firebase.

## Set it up

1. Connect your Apple or Google Play app in Apps & API keys.
2. Open Integrations → Firebase and select the store app.
3. Enter the Firebase App ID of its native data stream and a Measurement Protocol API secret.
4. Choose the currency for amounts: the original purchase currency or USD.
5. Save.

Amounts are the verified gross store amounts.

## Report the app instance ID

Google needs the Analytics app instance ID of the device. After analytics consent, send a firebase_identity event through the Aplyna SDK with the customer's exact App User ID, before the purchase.

> **Waiting for an ID**
> A purchase with no app instance ID waits. It is not sent with a guessed ID.

## Test it

Turn on Send Sandbox events to DebugView, enter the app instance ID of your test device and send a test. Look for aplyna_integration_test in Google Analytics DebugView.

- [Google Analytics setup guide](https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=firebase): Measurement Protocol for Firebase.
