36

Is there a way to disable Firebase analytics automatic screen reporting?

I have a few UIViewCOntroller's that i don't want to be reported.

So i want to manage the screen reporting my self.

Setting FirebaseAutomaticScreenReportingEnabled to NO didn't work

Thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
ilan
  • 4,402
  • 6
  • 40
  • 76

9 Answers9

32

For 2018, your Info.plist will have entries like this:

<key>FIREBASE_ANALYTICS_COLLECTION_ENABLED</key>
<string>NO</string>
<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
<string>YES</string>
<key>FirebaseScreenReportingEnabled</key>
<false/>
  1. Critical: Surprisingly this is in >>> YOUR <<< Info.plist. NOT the OTHER strange plist added by Google!

There are two plists!!!

  1. In this answer I have shown the exact, new, syntax needed - for late 2018.

  2. Edit your plist as "source". Paste in the above. It will not work if you try to use the convenient "value entry" interface in Xcode.

You will at last, finally, see this ...

enter image description here

2019...

Unfortunately, the details of this operation seem to be changing from time to time.

So it is uncertain if this precise procedure still works in all cases and in all variations. Good luck!

Community
  • 1
  • 1
Fattie
  • 27,874
  • 70
  • 431
  • 719
  • 2
    Note that it says **info.plist**. As @JeffRegan says above "I spent too long trying to get this to work. Add FirebaseScreenReportingEnabled to your project's Info.plist. Adding it to the GoogleService-Info.plist didn't work". Well...add me to that list :) – pbodsk Aug 31 '18 at 13:09
  • 1
    precisely @pbodsk , notice it is *YOUR* Info.plist! Not the whacky one added by Google. **Please note also that I have in this answer put the EXACT, NEW, SYTNAX which you must use.** – Fattie Aug 31 '18 at 14:11
  • 2
    and it worked perfectly, I could copy and paste your code and all was well, so thank you for this :) – pbodsk Sep 01 '18 at 07:45
  • i did the same, but it is not working, still throwing the error "[I-ACS036001] Analytics screen reporting is disabled. UIViewController transitions will not be logged." – R. Mohan Nov 18 '18 at 10:08
  • 1
    @Fattie would you know the equivalent of these to Android? – iadcialim24 Dec 22 '18 at 10:31
  • @iori24 that's a great question, unfortunately I do NOT as I have not worked closely with Firebase for a year or so. Seasons greets anyway .. cheers – Fattie Dec 22 '18 at 15:28
  • @Fattie so now, in 2022, what is the correct key? FirebaseScreenReportingEnabled. or FirebaseAutomaticScreenReportingEnabled? i have some issue that analytics show me (not set) for all my screens so i want to set these properties to true, so maybe it will fix the issue. i also though to add FirebaseAppDelegateProxyEnabled and set it also to true for any case... none of these properties that i mention are exist in my plist, and now i want to add them. – Asi Givati Jul 03 '22 at 07:52
  • 1
    @AsiGivati unfortunately I have not a clue :/ It is a fulltime job keeping up with Firebase' shenanigans. :/ – Fattie Jul 03 '22 at 15:13
20

You should be able to disable the Automatic Screen reporting by adding the plist flag FirebaseScreenReportingEnabled to Info.plist and set its value to NO (Boolean). Note that the value must be a Boolean and not a String.

Google Analytics for Firebase does NOT support the case of manual-only screen reporting. The plist flag FirebaseAutomaticScreenReportingEnabled has been renamed to FirebaseScreenReportingEnabled to reduce that confusion. We support automatic + manual screen reporting or no screen reporting at all.

AniV
  • 3,997
  • 1
  • 12
  • 17
  • 3
    I try to switch from Google Analytics to Firebase and realized Automatic Screen Reporting in Firebase does not work in all cases. It depends on how the view controllers are managed. In my case it also tracks screens that are invisible to the user because they are temporarily out of window bounds. It should be possible to disable automatic screen tracking and only track manually in order to no corrupt the metrics. – Manuel Sep 10 '17 at 03:08
  • 13
    I spent too long trying to get this to work. Add `FirebaseScreenReportingEnabled` to your project's `Info.plist`. Adding it to the `GoogleService-Info.plist` didn't work. – JeffRegan Sep 27 '17 at 18:35
  • 2
    Is there also a way to turn off all automatic analytics events? Such as "first_open", "session_start", etc... we have our own system and do not want the additional noise. Thanks. – Darko Nov 08 '17 at 07:53
  • Take a look at the "disable analytics collection" doc https://firebase.google.com/support/guides/disable-analytics – AniV Nov 08 '17 at 19:58
11

For 2020

On iOS, set FirebaseAutomaticScreenReportingEnabled to NO in your info.plist. On Android, set google_analytics_automatic_screen_reporting_enabled to false in your manifest.

Roy
  • 676
  • 8
  • 22
5

In info.plist file.

Add

FirebaseScreenReportingEnabled

and make sure its value is Boolean

and make it to

NO

.

Tushar Katyal
  • 412
  • 5
  • 12
4

Make Sure that you changed the Type of the Key to "Boolean" (Not a String)

Info.plist

2

In case anybody is unfamiliar with editing Info.plist, false value is zero 0

enter image description here

jakub1984
  • 31
  • 3
2

For 2022

This worked for me, based on this official blog post (from 2020):

iOS

Inside XCode - in Info.plist set FirebaseScreenReportingEnabled to type Boolean and select the value "NO", which will change to 0 - this is fine.

The Info.plist will then read like this if you open it directly, outside of XCode:

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

Android

Inside AndroidManifest.xml add:

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

source also docs here

Don't forget to rebuild.

JCraine
  • 1,159
  • 2
  • 20
  • 38
1

your flag FirebaseScreenReportingEnabled in plist should be of type Boolean

Ashwani Kumar
  • 465
  • 4
  • 9
1

Swift 4

Firebase Error Console

make sure this two line is Boolean

FirebaseAppDelegateProxyEnabled Boolean No

FirebaseScreenReportingEnabled Boolean No

Community
  • 1
  • 1