5

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"
>
timothyjoseph
  • 91
  • 2
  • 9

2 Answers2

11

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>
MD-11
  • 911
  • 1
  • 12
  • 25
  • 3
    Answer is correct, but not working because of this bug: https://github.com/firebase/firebase-android-sdk/issues/2225 (Firebase analytics v19.0.0). – Miroslav Michalec Jul 14 '21 at 08:55
1

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/>