Dynamic Links 还可与 Google Analytics 搭配使用。Google Analytics 可提供应用中发生的事件(例如有人通过点击 Dynamic Link 打开应用)的详细统计信息。您可以在 Firebase 控制台的“Analytics”部分查看这些数据。
下表概括了这两个分析选项的功能:
Firebase Dynamic Links 分析
Google Analytics
跟踪的事件
应用首次打开
应用重新打开
点击次数
重定向
应用安装
应用首次打开
应用重新打开
应用更新
数据访问
Firebase 控制台的“Dynamic Links”部分
REST API
Firebase 控制台的“Analytics”部分
BigQuery Export
自定义广告系列归因 (utm_ 参数)
这两个分析选项都可跟踪基于 Web 的跟踪工具经常会漏掉的应用内事件。例如,当 Dynamic Link 以通用链接的形式在 iOS 中打开时,该链接会直接由应用打开,因而绕过了 Web 分析工具;Firebase Dynamic Links 分析和 Google Analytics 都可以正确地跟踪此类事件。
GET https://firebasedynamiclinks.googleapis.com/v1/https%3A%2F%2Fexample.page.link%2FwXYz/linkStats?durationDays=7
Authorization: Bearer ya29.Abc123...
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["\u003cbr /\u003e\n\n| **Note:** Firebase Dynamic Links is *deprecated* and should not be used in new projects. The service will be shutting down soon. Follow the [migration guide](/support/dynamic-links-faq#how_should_i_migrate_from_the_service) and see the [Dynamic Links Deprecation FAQ](/support/dynamic-links-faq) for more information.\n\nTo help you gauge the effectiveness of your promotions and campaigns,\nFirebase Dynamic Links provides several ways to view analytics data and integrate\nwith analytics tools.\n\nFirebase Dynamic Links records events related to your Dynamic Links' performance,\nincluding events that happen outside of your apps, such as the number of times\nsomeone clicks on one of your short Dynamic Links. This data can be viewed in the\nDynamic Links section of the Firebase console and retrieved using a REST API.\n\nDynamic Links also work with [Google Analytics](/docs/analytics).\nGoogle Analytics provides detailed statistics for events that happen in\nyour app, such as when someone opens your app by clicking a Dynamic Link. This data\ncan be viewed in the Analytics section of the Firebase console.\n\nThe following table summarizes the features of these two analytics options:\n\n| | Firebase Dynamic Links analytics | Google Analytics |\n| Events tracked | - App first-open - App re-open - Clicks - Redirects - App installs | - App first-open - App re-open - App updates |\n| Data access | - Firebase console (Dynamic Links section) - REST API | - Firebase console (Analytics section) - BigQuery export |\n| Custom campaign attribution (`utm_` parameters) | | |\n|-------------------------------------------------|--------------------------------------------------------------------|----------------------------------------------------------|\n\nBoth analytics options track in-app events that web-based tracking tools often\nmiss. For example, when a Dynamic Link is opened on iOS as a Universal Link, the link\nis opened directly by the app, bypassing web analytics; these events are\ncorrectly tracked by both Firebase Dynamic Links analytics and\nGoogle Analytics.\n| **Note:** If you use Firebase Dynamic Links analytics or Google Analytics to track Dynamic Link usage, do not wrap your Dynamic Links in custom URLs, such as those created by link shortening services. By doing so, you prevent Firebase from accurately tracking your links.\n\nFirebase Dynamic Links analytics\n\nFirebase Dynamic Links tracks the number of times each of your short Dynamic Links have\nbeen clicked, as well as the number of times a click resulted in a redirect, app\ninstall, app first-open, or app re-open. You can view these statistics in the\nFirebase console or retrieve them with a REST API.\n\n| Event | Description | Firebase console | REST API |\n|----------------|---------------------------------------------------------------------------------------------------------------------------------------|------------------|----------|\n| CLICK | Count of any click on a Dynamic Link, irrespective to how it is handled and its destinations | | |\n| REDIRECT | Count of attempts to redirect users, either to the App Store or Play Store to install or update the app, or to some other destination | | |\n| APP_INSTALL | Count of actual installs (only supported by the Play Store) | | |\n| APP_FIRST_OPEN | Count of first-opens after an install | | |\n| APP_RE_OPEN | Number of times the Dynamic Link caused an app to be re-opened | | |\n\nFirebase console\n\nIn the [Firebase console](//console.firebase.google.com/), you can view event counts\nfor each short Dynamic Link you created in the console.\n\nREST API\n\nTo get event counts for any of your short Dynamic Links, whether you created the link\nin the console or programmatically, you can use the\n[Dynamic Links Analytics REST API](/docs/reference/dynamic-links/analytics).\n\nAn API call looks like the following example HTTP request: \n\n```\nGET https://firebasedynamiclinks.googleapis.com/v1/https%3A%2F%2Fexample.page.link%2FwXYz/linkStats?durationDays=7\n\nAuthorization: Bearer ya29.Abc123...\n```\n\nThe response to a request is a JSON object like the following: \n\n {\n \"linkEventStats\": [\n {\n \"platform\": \"ANDROID\",\n \"count\": \"123\",\n \"event\": \"CLICK\"\n },\n {\n \"platform\": \"IOS\",\n \"count\": \"123\",\n \"event\": \"CLICK\"\n },\n {\n \"platform\": \"DESKTOP\",\n \"count\": \"456\",\n \"event\": \"CLICK\"\n },\n {\n \"platform\": \"ANDROID\",\n \"count\": \"99\",\n \"event\": \"APP_INSTALL\"\n },\n {\n \"platform\": \"ANDROID\",\n \"count\": \"42\",\n \"event\": \"APP_FIRST_OPEN\"\n },\n\n ...\n\n ]\n }\n\nGoogle Analytics\n\nYou can also use Google Analytics in your app to track the performance of\nyour Dynamic Links. The following Analytics events are automatically logged when\nyou open a short or long Dynamic Link in your app.\n\n| Analytics events ||\n|-------------------------|-----------------------------------------------------------------------------------|\n| dynamic_link_first_open | Logged when a user opens the app for the first time via a Dynamic Link. |\n| dynamic_link_app_open | Logged when a user re-opens the app via a Dynamic Link. |\n| dynamic_link_app_update | Logged when the app is updated to a new version via a Dynamic Link. Android only. |\n\nYou can then view the logged data in the Analytics section of the\n[Firebase console](//console.firebase.google.com/).\n\nGoogle Analytics\" class=\"screenshot\"\\\u003e\n\nIf you mark Dynamic Link events as conversions, you can see how your Dynamic Links are\nperforming on the Attribution page.\n\nGoogle Analytics and Apple App Analytics campaign parameters\n\nYou use Dynamic Links with your existing Google Analytics custom campaigns and iTunes\nConnect App Analytics campaigns by specifying campaign parameters when you\n[create a Dynamic Link](/docs/dynamic-links/create-links). When a user opens a\nDynamic Link with campaign parameters specified, the campaign parameters are passed\non to Google Analytics or the App Store.\n\nBy adding these tracking parameters to your Dynamic Links, Google Analytics and\niTunes Connect can treat them like any other campaign it's measuring attribution\nreporting for, and you can view conversion events not just by the ad campaigns\nresponsible for bringing in those users, but also by which Dynamic Links might have\nbrought them in.\n\nThe following parameters are passed to Google Analytics: `utm_source`,\n`utm_medium`, `utm_campaign`, `utm_term`, `utm_content`.\n\nThe following parameters are passed to the App Store: `at`, `ct`, `mt`, `pt`"]]