1

I am following the "Get started with Google Analytics" instructions at https://firebase.google.com/docs/analytics/get-started?platform=android. The changes I made to my Android app code for this implementation are:

1.- /app/build.gradle

// Add the dependency for the Google Analytics Android library.
implementation 'com.google.firebase:firebase-analytics:16.0.8'

2.- /app/src/main/java/com/myapp/MainActivity.java

..........
import com.google.firebase.analytics.FirebaseAnalytics;
..........
public class MainActivity extends AppCompatActivity {
    ..........
    /**
     * The {@code FirebaseAnalytics} used to record screen views.
     */
    // [START declare_analytics]
    private FirebaseAnalytics mFirebaseAnalytics;
    // [END declare_analytics]
    ..........
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ..........
        // [START shared_app_measurement]
        // Obtain the FirebaseAnalytics instance.
        mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
        // [END shared_app_measurement]
        ..........
        // [START image_view_event]
        Bundle bundle = new Bundle();
        bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "MainActivity");
        mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
        // [END image_view_event]
    }
}

I am running the app successfully but I do not see at https://console.firebase.google.com/project/, specifically under "Firebase > Analytics > Events > Events | Parameter Reporting", I do not see anything related to the FirebaseAnalytics.Param.ITEM_NAME, "MainActivity" that supposedly I sent from my Android app to Firebase Analytics events. Maybe it takes several hours to refresh? Maybe I am doing something wrong? Please let me know what you think. Thank you.

enter image description here

enter image description here

Jaime Montoya
  • 6,915
  • 14
  • 67
  • 103
  • 1
    is there any error in log? can you try setting up verbose logging? adb shell setprop log.tag.FA VERBOSE – Amod Gokhale Feb 22 '20 at 11:51
  • I believe this question is answered [here](https://stackoverflow.com/questions/37604275/how-to-view-event-parameters-from-firebase-console). – Dan Morenus Feb 25 '20 at 00:57
  • @DanMorenus I do not see the "select_content" item in a dropdown anywhere. I go to the Firebase console at https://console.firebase.google.com/. I select my project. After that, on the left menu under "Analytics", I select "Events". I see two tabs: 1) Events. 2) Parameter Reporting. None of those tabs are displaying the custom events that I sent from the Android app. – Jaime Montoya Feb 25 '20 at 18:01
  • @AmodGokhale I already tried the verbose logging and it works correctly. In the logs I can see the strings that I sent. I am sure that works but I do not know where in console.firebase.google.com I am supposed to find those logs that I see from verbose logging. – Jaime Montoya Feb 25 '20 at 18:02
  • now select content is deprecated use SELECT_ITEM instead – Vijay Villiers May 16 '20 at 04:18

0 Answers0