Search code examples
androidfirebasegoogle-analyticsandroid-manifestfirebase-analytics

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


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

Solution

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