azavea / cac-tripplanner-android

GoPhillyGo Android app
https://gophillygo.org
Apache License 2.0
3 stars 3 forks source link

Investigate upgrading Google Analytics SDK #194

Closed ddohler closed 2 years ago

ddohler commented 2 years ago

We received a notification that we needed to accept the new Google Analytics terms of service, which I did. After doing that, I was presented with a message directing me to add the Google Analytics SDK to the application. This task is to investigate whether the following tasks are necessary and to perform them if they're easy (and necessary), or to make another issue if they're required but not easy.

Screenshot 2021-10-28 at 10-35-27 GoPhillyGo – Dashboard – Firebase console Screenshot 2021-10-28 at 10-35-49 GoPhillyGo – Dashboard – Firebase console

The text in the code boxes is:

buildscript {

  repositories {

    // Check that you have the following line (if not, add it):

    google()  // Google's Maven repository

  }

  dependencies {

    ...

    // Add this line

    classpath 'com.google.gms:google-services:4.3.10'

  }

}

allprojects {

  ...

  repositories {

    // Check that you have the following line (if not, add it):

    google()  // Google's Maven repository

    ...

  }

}
apply plugin: 'com.android.application'

// Add this line

apply plugin: 'com.google.gms.google-services'

dependencies {

  // Import the Firebase BoM

  implementation platform('com.google.firebase:firebase-bom:28.4.2')

  // Add the dependency for the Firebase SDK for Google Analytics

  // When using the BoM, don't specify versions in Firebase dependencies

  implementation 'com.google.firebase:firebase-analytics'

  // Add the dependencies for any other desired Firebase products

  // https://firebase.google.com/docs/android/setup#available-libraries

}
ktohalloran commented 2 years ago

Unfortunately, I can't offer a concrete answer here, but here are my discoveries, suggestions, and questions after digging through the code, the documentation, the Firebase dashboard, and Google Analytics: While the code appears to be set up to mostly log crashes and not so much other analytics, the actual Firebase dashboard only displays analytics but not crashes. We can see a few stats about Analytics in the Firebase dashboard but I’m blocked from seeing more information in Google Analytics either because 1) the associated Google Analytics dashboard was never set up, or 2) it exists but is separate from the web app's dashboard (which would be strange). After this research and assuming that crashes were the only thing we were interested in logging anyway, I was inclined to say that this upgrade isn’t necessary unless we want to fully incorporate the app with the new version of Google Analytics, as Google Analytics is supposed to add context to, but not be required for use of Crashlytics; however, based on a few discussions online, some people note having trouble seeing their Crashlytics data without having configured the whole Firebase connection to Google Analytics. As such, my next step was to gain access to Firebase to see whether our crash logging was working without the connection Google Analytics; however, apparently the screen for “no crashes” and “not configured to track crashes” is the same in Crashlytics, so I couldn’t really draw any conclusions from that. The next step is to test and potentially troubleshoot the app’s connection to Crashlytics, but I feel the time required to do so would extend beyond the estimate of this card and I therefore think it would be better spun off as its own issue.

ddohler commented 2 years ago

Thanks for the investigation and writeup! Based on this I'm going to make an issue to verify that Crashlytics is still working, but I'm not going to put it in the priority backlog for now.