集成 Google Analytics
bookmark_borderbookmark
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Google Analytics 平台,您可以跨多种设备和环境衡量用户与您的企业互动的情况。该平台会提供收集、存储、处理和报告上述用户互动所需的所有计算资源。
Analytics 数据收集在客户端和服务器端都可以进行。Google Analytics 提供易用的 API 和 SDK,以便将数据发送到 Google Analytics。除此之外,我们还开发了可在 App Engine 应用中使用的代码,可以轻松地将服务器端分析发送到 Google Analytics。
客户端分析数据收集
借助数据收集 API 和 SDK,您可以衡量用户与您的内容和营销计划的互动方式。实现数据收集功能后,您将能够在 Google Analytics 中或通过 Reporting API 查看用户互动数据。如需详细了解客户端分析数据收集,请根据您的客户端类型选择以下链接:
App Engine 服务器端分析数据收集
虽然 App Engine 已经提供在应用中记录事件的机制,但在 Google Analytics 中跟踪特定的服务器端事件可能更有利。部分优势如下:
- 历史数据分析 - 借助 App Engine,您可以配置日志文件最长保留天数或最大大小。超过该天数后,您将无权再访问这些日志文件。借助 Google Analytics 中的事件跟踪功能,您可以在更长的有效期内查看过往事件。
- 跟踪关键事件 - 应用的各种组件都会向日志文件写入数据,因而可能导致日志文件过于冗长。借助事件跟踪,您可以仅精确定位想要监控的关键事件,并跟踪这些事件以及一些其他元数据。
- 强大的用户界面 - 利用 Google Analytics 提供的功能丰富的用户界面,可以直观呈现、报告和导出这些服务器端事件。
将以下示例源代码集成到 App Engine 应用中,可以轻松实现此功能。如需详细了解此方法,请参阅 Google Analytics 开发者指南中的事件跟踪。
示例源代码
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-06。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-03-06。"],[[["The Google Analytics Platform is a comprehensive system for measuring user interactions across various devices and environments, providing the necessary resources for data collection, storage, processing, and reporting."],["Google Analytics supports both client-side and server-side data collection through user-friendly APIs and SDKs, allowing the tracking of user interactions with content and marketing initiatives."],["App Engine server-side event tracking in Google Analytics offers advantages like extended historical data analysis, the ability to focus on specific key events, and access to a powerful user interface for data visualization and reporting."],["Client-side analytics collection can be conducted in the web, Android, and iOS environments, as well as in any other environment using the Measurement Protocol."],["The provided code shows how to send a server-side event to Google Analytics using App Engine."]]],[]]