<p align="center">
  <a href="https://rnfirebase.io">
    <img width="160px" src="https://i.imgur.com/JIyBtKW.png"><br/>
  </a>
  <h2 align="center">React Native Firebase - Analytics</h2>
</p>

<p align="center">
  <a href="https://api.rnfirebase.io/coverage/analytics/detail"><img src="https://api.rnfirebase.io/coverage/analytics/badge?style=flat-square" alt="Coverage"></a>
  <a href="https://www.npmjs.com/package/@react-native-firebase/analytics"><img src="https://img.shields.io/npm/dm/@react-native-firebase/analytics.svg?style=flat-square" alt="NPM downloads"></a>
  <a href="https://www.npmjs.com/package/@react-native-firebase/analytics"><img src="https://img.shields.io/npm/v/@react-native-firebase/analytics.svg?style=flat-square" alt="NPM version"></a>
  <a href="/LICENSE"><img src="https://img.shields.io/npm/l/react-native-firebase.svg?style=flat-square" alt="License"></a>
  <a href="https://lerna.js.org/"><img src="https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg?style=flat-square" alt="Maintained with Lerna"></a>
</p>

<p align="center">
  <a href="https://invertase.link/discord"><img src="https://img.shields.io/discord/295953187817521152.svg?style=flat-square&colorA=7289da&label=Chat%20on%20Discord" alt="Chat on Discord"></a>
  <a href="https://twitter.com/rnfirebase"><img src="https://img.shields.io/twitter/follow/rnfirebase.svg?style=flat-square&colorA=1da1f2&colorB=&label=Follow%20on%20Twitter" alt="Follow on Twitter"></a>
  <a href="https://www.facebook.com/groups/rnfirebase"><img src="https://img.shields.io/badge/Follow%20on%20Facebook-4172B8?logo=facebook&style=flat-square&logoColor=fff" alt="Follow on Facebook"></a>
</p>

---

Analytics integrates across Firebase features and provides
you with unlimited reporting for up to 500 distinct events
that you can define using the Firebase SDK. Analytics reports
help you understand clearly how your users behave, which enables
you to make informed decisions regarding app marketing and
performance optimizations.

[> Learn More](https://firebase.google.com/products/analytics/)

## Installation

Requires `@react-native-firebase/app` to be installed.

```bash
yarn add @react-native-firebase/analytics
```

### Expo

If you use Expo, including EAS Build, and want to configure iOS Analytics Podfile flags, add the Analytics config plugin to your `app.json` / `app.config.js`:

```json
{
  "expo": {
    "plugins": [
      [
        "@react-native-firebase/analytics",
        {
          "ios": {
            "withoutAdIdSupport": true,
            "googleAppMeasurementOnDeviceConversion": true
          }
        }
      ]
    ]
  }
}
```

The `withoutAdIdSupport` option adds `$RNFirebaseAnalyticsWithoutAdIdSupport = true` during prebuild, which excludes `FirebaseAnalytics/IdentitySupport`. The `googleAppMeasurementOnDeviceConversion` option adds `$RNFirebaseAnalyticsGoogleAppMeasurementOnDeviceConversion = true`, which includes Google Analytics on-device conversion measurement support. You may omit either option if it is not needed.

## Documentation

- [Quick Start](https://rnfirebase.io/analytics/usage)
- [Reference](https://rnfirebase.io/reference/analytics)

### Additional Topics

- [Screen Tracking](https://rnfirebase.io/analytics/screen-tracking)

## License

- See [LICENSE](/LICENSE)

---

<p>
  <img align="left" width="75px" src="https://static.invertase.io/assets/invertase/invertase-rounded.png">
  <p align="left">
    Built and maintained with 💛 by <a href="https://invertase.io">Invertase</a>.
  </p>
</p>

---
