Transitioning from Google Analytics to Firebase Analytics implementation

Context

I’ve been working with Google Analytics in my Android app for a while now, but I’m looking into switching to Firebase Analytics since it seems to be the newer approach that Google is pushing.

My confusion

I’m running into several issues while trying to figure out how to make this transition properly. Here are the main things I can’t figure out:

Property ID Setup: In the old system, I had to use a property ID with the tracker creation method. I don’t see this requirement anymore. Is it handled automatically now?

Ad Tracking: There used to be a method called “enableAdvertisingIdCollection” for gathering advertising data. I can’t locate this in the new API. Does it collect this information by default?

Debug Mode: The old “setDryRun” method let me prevent data from being sent to servers during testing. I don’t see this option now. Is debug mode automatic for development builds?

Screen Tracking: Previously I tracked screens manually like this:

public void recordScreen(String screenName) {
    analyticsTracker.setScreenName(screenName);
    analyticsTracker.send(new HitBuilders.ScreenViewBuilder().build());
}

Does Firebase Analytics handle screen tracking automatically through activity lifecycle?

Event Tracking: This is my biggest question. I used to track events with category, action, label and value:

public void recordUserAction(final String category, final String action, final String label, final long value) {
    analyticsTracker.send(new HitBuilders.EventBuilder()
            .setCategory(category).setAction(action)
            .setLabel(label).setValue(value).build());
}

Now I see it uses bundles instead:

Bundle params = new Bundle();
params.putString(FirebaseAnalytics.Param.ITEM_ID, itemId);
params.putString(FirebaseAnalytics.Param.ITEM_NAME, itemName);
params.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "video");
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, params);

How should I map my old tracking structure to this new bundle system?

Any help would be great since I’m pretty confused about making this switch.

Did this exact migration two years ago on a large shopping app. Here’s what actually happens:

Property ID: It’s automatic now. Firebase handles connection through your google-services.json file. No more manual property ID setup.

Ad Tracking: Enabled by default in Firebase Analytics. You don’t need to call anything special. Want to disable it? Add specific manifest entries.

Debug Mode: Use adb shell setprop debug.firebase.analytics.app YOUR_PACKAGE_NAME for testing. Way cleaner than the old setDryRun approach.

Screen Tracking: Firebase can do automatic screen tracking, but it’s not great. I still do manual tracking because automatic misses custom fragments and gives weird names.

For manual screen tracking:

firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, bundle);

Event Mapping: This was the trickiest part. Your old category/action/label structure doesn’t map directly.

I ended up creating a helper method:

public void trackLegacyEvent(String category, String action, String label, long value) {
    Bundle params = new Bundle();
    params.putString("event_category", category);
    params.putString("event_label", label);
    params.putLong("value", value);
    firebaseAnalytics.logEvent(action.toLowerCase().replace(" ", "_"), params);
}

But I’d recommend switching to Firebase’s predefined events where possible. They give better insights in the console and integrate better with other Google tools.

Migration took me about a week to fully test and validate. Data structure’s different but reporting is much better.