awesome-cordova-plugins/docs/plugins/firebase-analytics/README.md

48 lines
1.5 KiB
Markdown
Raw Normal View History

2021-09-29 20:09:02 +08:00
# Firebase Analytics
<p style="color:orange">
This plugin is still in beta stage and may not work as expected. Please
submit any issues to the <a target="_blank"
href="/issues">plugin repo</a>.
</p>
2021-09-29 20:38:45 +08:00
2021-09-29 20:09:02 +08:00
```
$ ionic cordova plugin add cordova-plugin-firebase-analytics
2021-09-29 21:19:55 +08:00
$ npm install @awesome-cordova-plugins/firebase-analytics
2021-09-29 20:09:02 +08:00
```
2021-09-29 21:19:55 +08:00
## [Usage Documentation](https://danielsogl.gitbook.io/awesome-cordova-plugins/plugins/firebase-analytics/)
2021-09-29 20:09:02 +08:00
Plugin Repo: [https://github.com/chemerisuk/cordova-plugin-firebase-analytics](https://github.com/chemerisuk/cordova-plugin-firebase-analytics)
Cordova plugin for Firebase Analytics
Go to firebase console and export google-services.json and GoogleService-Info.plist. Put those files into the root of your cordova app folder.
NOTE: on iOS in order to collect demographic, age, gender data etc. you should additionally include AdSupport.framework into your project.
## Using capacitor?
2021-09-29 20:38:45 +08:00
For Android you'll have to add in __android/app/src/main/AndroidManfiest.xml__ under `<application>`
2021-09-29 20:09:02 +08:00
```
<meta-data
tools:replace="android:value"
android:name="firebase_analytics_collection_enabled"
android:value="true"/>
<meta-data
tools:replace="android:value"
android:name="google_analytics_automatic_screen_reporting_enabled"
android:value="false"/>
```
And in the same file, you'll have to add `xmlns:tools="http://schemas.android.com/tools"` to your _manifest_ tag.
## Supported platforms
- Android
- iOS
2021-09-29 20:38:45 +08:00