How do I update the manifest for Google Analytics on Android?

Viewed 2427

I am trying to disable automatic screen reporting for Google Firebase Analytics. In the Firebase Blog post, it states

On Android, set google_analytics_automatic_screen_reporting_enabled to “false” in your manifest.

How should I change my AndroidManifest.xml to follow the above instructions?

I modified the manifest tag like this, but I'm not sure if this is correct.

<manifest
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  google_analytics_automatic_screen_reporting_enabled="false"
  package="com.myapp.name"
>
2 Answers

You need to add it as <meta-data> inside of the <application>:

<manifest>
    <application>
        <meta-data
            android:name="google_analytics_automatic_screen_reporting_enabled"
            android:value="false" />
        <!-- ... -->
    </application>
</manifest>

Since u asked for android but for others posting the key for iOS also. On iOS, set FirebaseAutomaticScreenReportingEnabled to “NO” in your info.plist. On Android, set google_analytics_automatic_screen_reporting_enabled to “false” in your manifest. For Android: In AndroidManifest.xml file

<meta-data
           android:name="google_analytics_automatic_screen_reporting_enabled"
           android:value="false" />
       
   
For iOS: In Info.plist file
   

<key>FirebaseAutomaticScreenReportingEnabled</key>
       <false/>
Related