Firebase Agent Skills Let Coding Agents Edit GA4 App Tracking
On 18 November, the Google Analytics release log added an entry called “Google Analytics for Firebase (GA4F) SDK agent skills”. App developers can now give a coding agent a set of Firebase skills. The agent can then change behavioural and conversion tracking in iOS and Android apps. The release log says initial integration and screen view logging are supported. More development tasks are listed as coming soon. This article covers how to install the skills, what to ask for, what the resulting code should look like, and how to check it.
What an agent skill is
A skill is a folder of instructions that a coding agent loads when a task matches it. Firebase describes its skills as portable modules built around a SKILL.md file. They are listed on the Firebase agent skills page. Most cover other Firebase products, such as authentication, hosting and Firestore. The one that matters here is firebase-analytics, which covers getting started and measuring screen views in iOS and Android apps. The page recommends installing the Firebase MCP server alongside the skills. The Firebase Analytics getting started page says AI assistance is currently available for native Android and Apple apps only.
Getting started
Run the install from the root of the app project.
Claude Code:
claude plugin marketplace add firebase/agent-skills
claude plugin install firebase@firebase
Codex (OpenAI) terminal:
codex plugin marketplace add firebase/agent-skills
codex plugin add firebase@firebase
Cursor, Antigravity and other agents use the npx route. Add --agent=cursor or --agent=antigravity for those two, or leave the flag off for any other agent. Cursor example below:
npx skills add firebase/agent-skills --agent=cursor
To update, run claude plugin marketplace update firebase for Claude Code, or npx skills update --all for the npx installs. You can also invoke a skill by hand by typing / in the agent chat.
Firebase also publishes two sample apps to compare against: the iOS quickstart and the Android quickstart.
Triggering a tracking change
The skill loads when the task matches it, so the prompt matters more than the install. A vague prompt leaves the agent to choose names. A specific one gives it something to follow. For example:
Set up Google Analytics for Firebase in this app and log a screen_view
event on every screen listed below. Use these exact screen_name values.
Do not infer names from class names.
HomeScreen -> "home"
ProductListScreen -> "product_list"
ProductDetailScreen -> "product_detail"
CheckoutScreen -> "checkout"
Disable automatic screen reporting so each screen is logged once.
What the iOS change looks like
For a UIKit view controller, the documentation suggests logging in viewDidAppear. The event is AnalyticsEventScreenView, with a screen name and a screen class:
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
Analytics.logEvent(AnalyticsEventScreenView,
parameters: [AnalyticsParameterScreenName: "product_detail",
AnalyticsParameterScreenClass: "ProductDetailViewController"])
}
SwiftUI apps do not get automatic screen names. The documentation says to set them manually or use the FirebaseAnalyticsSwift module. The manual route logs the same event from onAppear:
ProductDetailView()
.onAppear {
Analytics.logEvent(AnalyticsEventScreenView,
parameters: [AnalyticsParameterScreenName: "product_detail",
AnalyticsParameterScreenClass: "ProductDetailView"])
}
What the Android change looks like
On Android, the documentation suggests logging in onResume. In Kotlin:
override fun onResume() {
super.onResume()
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW) {
param(FirebaseAnalytics.Param.SCREEN_NAME, "product_detail")
param(FirebaseAnalytics.Param.SCREEN_CLASS, "ProductDetailActivity")
}
}
The Java equivalent builds a Bundle and passes it to logEvent:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SCREEN_NAME, "product_detail");
bundle.putString(FirebaseAnalytics.Param.SCREEN_CLASS, "ProductDetailActivity");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SCREEN_VIEW, bundle);
If screen_class is not set, Analytics falls back to a default based on the view controller or activity in focus.
Turn off automatic reporting to prevent counting every screen twice
Analytics already logs a screen_view event on screen transitions. Adding manual calls on top of that doubles the counts unless automatic reporting is switched off. The documentation gives one setting for each platform.
On iOS, set FirebaseAutomaticScreenReportingEnabled to NO in Info.plist. On Android, add this inside the <application> tag of AndroidManifest.xml:
<meta-data
android:name="google_analytics_automatic_screen_reporting_enabled"
android:value="false" />
This is the first thing to look for in an agent’s diff. A change that adds manual calls and leaves automatic reporting on will look correct and report every screen twice.
Keep the names in one place
An agent that types the string “product_detail” into each file also types “product_details” or “ProductDetail” into the next. A single list of constants removes that risk, and gives a reviewer one file to check. On iOS:
enum ScreenName {
static let home = "home"
static let productList = "product_list"
static let productDetail = "product_detail"
static let checkout = "checkout"
}
Android uses the same idea in a Kotlin object:
object ScreenName {
const val HOME = "home"
const val PRODUCT_LIST = "product_list"
const val PRODUCT_DETAIL = "product_detail"
const val CHECKOUT = "checkout"
}
Add “use the ScreenName constants for every screen_name value” to the prompt.
A custom event
The same pattern works for a custom event. The Firebase events documentation shows a Swift example, with parameters passed as a dictionary:
Analytics.logEvent("share_image", parameters: [
"name": name,
"full_text": text,
])
The Kotlin version uses a param block:
firebaseAnalytics.logEvent("share_image") {
param("image_name", name)
param("full_text", text)
}
Event names are case-sensitive, and an app can have up to 500 distinct custom event types. A custom parameter only appears in reports once it is registered under Analytics, Custom Definitions in the Firebase console. An agent can write the logging call. It cannot register the parameter for you, so add that to the release checklist.
Checking the result
Walk the app on a real device with debug mode on, and confirm each screen appears once with the expected name.
On iOS, add -FIRDebugEnabled under “Arguments Passed On Launch” in the Xcode scheme. On Android:
adb shell setprop debug.firebase.analytics.app PACKAGE_NAME
Events then stream into DebugView. The documentation notes that debug mode events go into the daily BigQuery export by default, so a developer traffic data filter is worth setting up first. To see the raw log lines on Android, enable verbose logging and watch logcat:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
On iOS, the equivalent is the -FIRAnalyticsVerboseLoggingEnabled launch argument.
Four checks catch most problems:
- Names: Every
screen_namein DebugView matches the spec, in the spec’s casing, on both platforms. - Counts: Each screen appears once per view. Two events a few milliseconds apart means automatic reporting is still on.
- Classes: The
screen_classvalue is either deliberate or left to the default. It is not a leftover from a copy and paste. - Registration: Any new custom parameter is registered in Custom Definitions before release. After release, compare screen view counts for the same journeys against the previous app version. A sudden jump or drop on one screen is easier to explain the week it happens.
A separate set of skills for the reporting APIs
Google has a second set of skills for a different job. The Google Analytics agent skills page covers the Data API and the Admin API. These read data and manage a property. They do not change what an app sends. Install them with npx, using the agent flag for your tool:
npx skills add google/skills/skills/analytics --agent=claude-code
There are two skills. google-analytics-data-api-basics covers enabling the API, authentication and running report queries, including checking whether a dimension and metric can be combined. google-analytics-admin-api-basics covers account summaries, properties, data streams, custom dimensions and metrics, key events and Measurement Protocol secrets. The page lists Node.js and a Google Cloud project with access to a GA property as prerequisites. So there are now two routes by which an agent can touch a GA4 setup. One edits the tracking code inside an app, whilst the other changes the property configuration or pulls reports from it
What to do now
Ask the app team whether the Firebase skills are installed. If they are, ask what tracking changes the agent has made so far, and whether anyone reviewed them against a written spec. For agencies delivering app tracking, a written screen and event specification is the cheapest protection. It gives the agent something definite to follow and gives the reviewer something definite to check against. Our view is that agents make the typing cheaper and leave the QA exactly where it was.
We hope you found the above useful. Do get in touch if you would like a second pair of eyes on an app tracking setup.
Newsletter
Occasional notes on data, tracking & AI-readiness
No spam, no growth-hacking. Just an email when there's something worth reading.