Measure key events in mobile apps
Stay organized with collections
Save and categorize content based on your preferences.
Key event measurement can help you to understand if user interactions
effectively lead to valuable customer activity within your mobile app, such as
in-app purchases, subscriptions, and sign-ups.
Mobile app conversions and key events may be measured in Google Ads and
Google Analytics 4.
Google Ads
To capture conversions in your Ads account, import events from your Google
Analytics 4 property:
- Sign in to your Google Ads account.
- Click
in the upper-right corner of your account.
- Under the section labeled Measurement click Conversions.
- Click
.
- Select App from the list of conversion types.
- Click Google Analytics 4 (Firebase), then click Continue.
- Check the box next to each event you’d like to import, click Import.
- Click Done.
Learn more about Google Ads conversions.
Google Analytics 4
Google Analytics 4 properties enable unified measurement of user interactions
and events across your website and mobile app. Google Analytics 4 collects many
events by default, and some events are automatically marked as key events. App
data streams within Google Analytics 4 properties utilize the Firebase SDK to
send events. Learn more about events.
Additionally, you can enable or turn off other automatically collected events,
or mark custom events as key events as well.
You can register an event as a key event either before or after the event is
sent.
To register an event before it is sent:
- In Analytics, navigate to the reports for your Google Analytics 4 property.
- Click Key events.
- Click New key event.
- Enter the name of the event you want to identify as a key event. Note:
Make sure the event name you enter is exactly the same as the event that you
are sending.
- Click Save.
If you’ve already sent the event previously and want to mark it as a key event:
- In Analytics, navigate to the reports for your Google Analytics 4 property.
- Click All events.
- In the row for the event, turn on the switch in the Mark as key event
column.
To send a custom event, do the following:
Android: Java
Bundle params = new Bundle();
params.putString("image_name", name);
params.putString("full_text", text);
mFirebaseAnalytics.logEvent("share_image", params);
Android: Kotlin
firebaseAnalytics.logEvent("share_image") {
param("image_name", name)
param("full_text", text)
}
iOS: Swift
Analytics.logEvent("share_image", parameters: [
"name": name as NSObject,
"full_text": text as NSObject
])
iOS: Objective-C
[FIRAnalytics logEventWithName: @ "share_image"
parameters: @ {
@ "name": name,
@ "full_text": text
}
];
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[null,null,["Last updated 2024-10-09 UTC."],[[["\u003cp\u003eKey event measurement allows you to track user interactions within your mobile app that lead to valuable customer actions like purchases and sign-ups.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Ads and Google Analytics 4 can be used to measure mobile app conversions and key events for analysis and optimization.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Analytics 4 provides unified measurement across your website and mobile app, collecting many events by default with the option to customize key events for specific tracking needs.\u003c/p\u003e\n"],["\u003cp\u003eYou can mark events as key events in Google Analytics 4 either before they are sent or retroactively after they have been recorded.\u003c/p\u003e\n"]]],["Key mobile app user activities, like purchases and sign-ups, can be measured as conversions in Google Ads and key events in Google Analytics 4. In Google Ads, import events from Google Analytics 4 by navigating to **Conversions** and selecting **App**. In Google Analytics 4, register events as key events by entering the event's exact name under **Key events** or marking the event under **All events**. Custom events can be sent via the Firebase SDK, as demonstrated with code examples for Android and iOS.\n"],null,["# Measure key events in mobile apps\n\nKey event measurement can help you to understand if user interactions\neffectively lead to valuable customer activity within your mobile app, such as\nin-app purchases, subscriptions, and sign-ups.\n\nMobile app conversions and key events may be measured in [Google Ads](#google_ads) and\n[Google Analytics 4](#google_analytics_4).\n\nGoogle Ads\n----------\n\nTo capture conversions in your Ads account, import events from your Google\nAnalytics 4 property:\n\n1. Sign in to your [Google Ads account](https://ads.google.com/).\n2. Click in the upper-right corner of your account.\n3. Under the section labeled **Measurement** click **Conversions**.\n4. Click .\n5. Select **App** from the list of conversion types.\n6. Click **Google Analytics 4 (Firebase)** , then click **Continue**.\n7. Check the box next to each event you'd like to import, click **Import**.\n8. Click **Done**.\n\n[Learn more about Google Ads conversions](https://support.google.com/google-ads/answer/6366292).\n\nGoogle Analytics 4\n------------------\n\nGoogle Analytics 4 properties enable unified measurement of user interactions\nand events across your website and mobile app. Google Analytics 4 collects many\nevents by default, and some events are automatically marked as key events. App\ndata streams within Google Analytics 4 properties utilize the [Firebase SDK](https://firebase.google.com/docs/guides) to\nsend events. [Learn more about events](https://developers.google.com/tag-platform/devguides/events).\n\nAdditionally, you can [enable or turn off](https://support.google.com/analytics/answer/9267568) other automatically collected events,\nor mark custom events as key events as well.\n\nYou can register an event as a key event either before or after the event is\nsent.\n\nTo register an event before it is sent:\n\n1. In Analytics, navigate to the reports for your Google Analytics 4 property.\n2. Click **Key events**.\n3. Click **New key event**.\n4. Enter the name of the event you want to identify as a key event. *Note:\n Make sure the event name you enter is exactly the same as the event that you\n are sending.*\n5. Click **Save**.\n\nIf you've already sent the event previously and want to mark it as a key event:\n\n1. In Analytics, navigate to the reports for your Google Analytics 4 property.\n2. Click **All events**.\n3. In the row for the event, turn on the switch in the **Mark as key event** column.\n\nTo send a custom event, do the following: \n\n### Android: Java\n\n Bundle params = new Bundle();\n params.putString(\"image_name\", name);\n params.putString(\"full_text\", text);\n mFirebaseAnalytics.logEvent(\"share_image\", params);\n\n### Android: Kotlin\n\n firebaseAnalytics.logEvent(\"share_image\") {\n param(\"image_name\", name)\n param(\"full_text\", text)\n }\n\n### iOS: Swift\n\n Analytics.logEvent(\"share_image\", parameters: [\n \"name\": name as NSObject,\n \"full_text\": text as NSObject\n ])\n\n### iOS: Objective-C\n\n [FIRAnalytics logEventWithName: @ \"share_image\"\n parameters: @ {\n @ \"name\": name,\n @ \"full_text\": text\n }\n ];"]]