设置 Google Analytics 4

Google Analytics 4 是一家已与 Adjust 集成的数据分析合作伙伴。我们的集成允许 Google Analytics 4 通过自动回传接收 Adjust 监测的数据。您可以使用合作伙伴的工具进行数据分析并获取洞见。

在本文中了解如何为您的应用设置 Google Analytics 4 监测,其中包括激活集成,以及选择 Adjust 可以与 Google Analytics 4 分享的数据。

操作前须知

要求

iOS | 安卓 | Windows | Unity | React Native | Flutter | Adobe Air | Cordova | Marmalade | Xamarin | Cocos2d-x | Titanium | Corona

凭证

Firebase App ID (for mobile apps), Measurement ID (for web apps), API Secret

  • 如需帮助查找凭证,请联系您的 Google Analytics 4 代表。

在您的 Google Analytics 4 控制面板中:

要获取 Firebase App ID:

  1. 前往Firebase 控制台
  2. 找到并点击您的项目
  3. 在左侧面板中点击齿轮图标 > 项目概览 (Project Overview) 旁的项目设置 (Project settings)
  4. 在您的应用 (Your apps) 下选择您的应用并在 App ID 下找到 Firebase App ID

要获取 API 密钥:

  1. 前往Google Analytics 控制面板
  2. 选择管理 (Admin) > 数据收集和修改 (Data collection and modification) > 数据流 (Data streams)
  3. 选择应用的数据流,然后在 Measurement Protocol API 密钥 (Measurement Protocol API secrets)> 密钥值 (Secret value) 下找到您的 API 密钥
  4. 如果没有 API 密钥,请在 Measurement Protocol API 密钥下选择创建,输入名称并创建

在 Campaign Lab 中选择 Google Analytics 4 和应用

  1. 找到 Campaign Lab​ ,选择 合作伙伴​ 。
  2. 选择 新合作伙伴​ > Google Analytics 4​ 。选择 下一步​ 进入下一界面。
  3. 应用选择​ 界面选择要创建链接的应用,启用集成来与 Google Analytics 4 分享数据。
  4. 选择 下一步​ 。

启用数据分享

启用数据分享以激活与 Google Analytics 4 的集成。要启用数据分享:

  1. 输入您的 Firebase App ID (for mobile apps), Measurement ID (for web apps), API Secret。

启用与 Google Analytics 4 的数据分享后,Adjust 会默认自动向 Google Analytics 4 发送以下数据:

  • 安装
  • 再归因

设置数据分享

如果您的多平台应用启用了多个平台的数据分享,那么可以:

  1. 通过选择 使用平台特定设置​ 来在平台层级区分数据共享设置。
  2. 通过选择 使用全局设置​ 来为多个平台应用相同的数据共享设置。

哪些数据会默认分享?​ 部分, 查看 Adjust 默认与 Google Analytics 4 分享的活动:

  • 安装
  • 再归因

发送额外数据

选择您想通过回传与 Google Analytics 4 分享的数据量和数据类型。Google Analytics 4 可能会使用此信息来优化表现。

要发送额外数据,您可以查看并自定义以下选项:

为您的应用启用 Google Analytics 4

设置概览​ 界面,您可以检查自己的选择,也可以返回并更改以下内容:

  • 所选应用
  • 数据分享选项

选择 启用合作伙伴​ ,为您的应用启用 Google Analytics 4 。数据分析合作伙伴不使用推广活动链接。启用合作伙伴后,我们的集成会通过自动回传发送归因和应用内事件数据。

合作伙伴特定设置说明

Our Google Analytics 4 (GA4) integration​ allows Adjust to send cross-network attribution data to Google Analytics. You should enable this integration if you are already logging conversions with the Google Analytics for Firebase SDK​ or using Google Analytics 4 for web​. Adjust leverages the campaign_details event of the Measurement Protocol API​ to send conversions along with attribution details.

Requirements

This integration supports both mobile apps and web-based apps​:

  • For mobile apps:
    • The Firebase SDK​ must be integrated into your app.
    • A Firebase App ID​ is required.
    • You must implement session partner parameters​ within the Adjust SDK to capture and send Google Analytics 4’s app_instance_id.
    • You should set app_instance_idbefore initializing the Adjust SDK​.
  • For web-based apps:
    • A Measurement ID​ from your GA4 web property is required.
    • You must implement session partner parameters​ within the Adjust SDK to capture and send Google Analytics 4’s client_id.
    • You should set client_idbefore initializing the Adjust SDK​.

These identifiers (app_instance_id for mobile, client_id for web) are essential because Google Analytics 4 uses them to uniquely identify each user or app instance. If these values are not properly tracked and passed, Adjust will not be able to fire callbacks to Google Analytics.

Follow the guides linked below to use this feature:

iOS / Android / Unity / Flutter / React Native

Additional Notes

  • Organic traffic​ is not shared​ via this integration.
  • Due to differences in attribution methodology, Google Analytics does not accept conversions older than 3 days​.
  • Depending on your Adjust Link attribution windows​, you might see discrepancies because some conversions may not be reported in GA4.

About Session ID

You can send the Firebase Session ID through the session partner parameter ga4_session_id

About User ID

You can send the Firebase User ID through the session partner parameter ga4_user_id

转发给 Google Analytics 4 的所有参数列表

Google Analytics 4 要求 Adjust 在回传中发送以下参数 (数据点):

占位符信息
{adgroup_name}广告组名称,取自跟踪链接
{campaign_name}推广活动名称,取自跟踪链接
{creative_name}素材名称,取自跟踪链接
{engagement_time}交互时间戳
{network_name}渠道名称,取自跟踪链接