필터

Google Analytics

Connect Branch and Google Analytics to unlock a more holistic picture of the customer journey for your app.

1328

Overview

Send your Branch data to your Google Analytics dashboard, helping you understand the power of Branch as an acquisition and re-engagement pathway. If you're interested in the segment of users coming into your apps through Branch and want to measure their events against your other cohorts, this guide can help.

작동 방식

Once the Branch SDK is integrated into an app, Branch can detect which Branch Links are leading to opens, installs, re-installs, and down funnel events. Enabling this integration and providing your Google Analytics Tracking Id will result in Branch automatically forwarding events to Google Analytics, in the exact format Google Analytics expects. This includes automatically setting various UTM tags that can be used to determine the source of new users.

Branch Events Sent to Google Analytics

Branch will send installs and opens, commerce, content, user lifecycle, as well as any custom events you track with Branch. Clicks, web session starts, and web pageviews will not be sent. Branch also sends over analytics data that is attached to the link, whether it's UTM tags or fields set on the Branch Dashboard (e.g. Campaign, Channel, Feature). This will allow you to analyze which campaigns, channels, etc. are helping you acquire and engage users. You can see the list of fields that we send to Google Analytics here.

어떻게 생겼습니까?

Branch 이벤트는 Google Analytics에서 트래킹된 다른 이벤트와 함께 나타납니다. 다음은 테스트 정보가 설정된 Source 화면의 예입니다.

966

To view installs and opens, as well as any custom events you track with Branch as they are occur, navigate to Real-Time > Events. The event category for all Branch events is BranchEvent.

1434

전제 조건

In order to enable Google Analytics, you need to have completed the following:

  1. Admin access to your Branch Dashboard.
  2. Enabled Data Feeds for your Branch account.
  3. Implemented the Branch SDK into your mobile app (iOS | Android)
  4. Google Analytics SDK 구현
  5. Admin access to your Google Analytics account.

Enable Google Analytics

1. Retrieve IDs from Google Analytics

Log into your Google Analytics Dashboard. Make sure that you have admin access.

For Google Analytics 4 you need to retrieve your Measurement ID:

  • In Admin, make sure that you have the desired account and property selected.
  • In the Property column, click Data Streams, then click your web data stream. Your G-XXXX Measurement ID appears in the upper right portion of the panel.
1112

For Universal Analytics (Legacy) you need to retrieve your Tracking ID:

  • Go to Admin.
  • In the Property column, click Property Settings. Your UA-XXXX Tracking ID appears at the top of the Property Settings Page
762

2. Connect Google Analytics in Branch

In the Branch Dashboard in Data Feeds → Data Integrations tab, find and search for Google Analytics.

Enter the IDs from the previous step. Enter them into the iOS and Android fields in the Branch Dashboard, and hit Save.

1714

Note: If you only have one Measurement/Tracking ID, then enter the same ID for both iOS and Android.

3. Pass Metadata to the Branch SDK

👍

개발자 필요

Developers on your mobile app are required for this step

For a given app session, the unique Google Analytics identifier needs to be passed to the Branch SDK (before the Branch SDK initializes) in order for Branch to properly send events to Google Analytics.

Compatible IDs

Version식별자Google ShortcodeBranch Metadata Key
Google Analytics 4User IDuid$google_analytics_user_id
Universal AnalyticsClient ID (for device identification)cid$google_analytics_client_id

Specify the Branch metadata key for your Google Analytics tracking identifier

Pass User ID to Branch

branch.setRequestMetadataKey("$google_analytics_user_id", "USER-ID-HERE")
Branch.getInstance().setRequestMetadata("$google_analytics_user_id", "USER-ID-HERE");

Pass Client ID to Branch

Note: You just need to pass a random UUID on install and store it in local storage for later use for the Branch SDK.

// Add before initializing Branch session.
let uuid = UUID().uuidString;
let branch = Branch.getInstance();
branch.setRequestMetadataKey("$google_analytics_client_id", uuid)
// Need import java.util.UUID
// Call after instantiating Branch in your application's onCreate before you call Branch initSession
UUID uuid = UUID.randomUUID();
String client_id = uuid.toString();

Branch.getInstance().setRequestMetadata("$google_analytics_client_id",client_id);

4. Verify Data Sent

Once the above steps are complete, you are now ready to start launching campaigns. Branch-attributed conversions will be sent to Google Analytics. To verify data is being sent from Branch to Google Analytics, you can look at the Branch Dashboard's Liveview Webhook Records and apply the following filter:

필터Operator
webhook partner keyequalsdi_google_analytics
1833

📘

Wait Period

Please be patient as data may take some time to flow through Branch's attribution systems and onto Google Analytics. If data has not appeared in Google Analytics after 30 minutes of completing a test conversion, review the above steps to see if you may have missed something.

Properties Sent to Google Analytics

속성 이름Sourced From예시 필수
vAPI version[fixed]1
tidTracking IDBranch 대시보드UA-XXXXXX-Y
dsSource (mobile SDK)[fixed]
an애플리케이션 이름[fixed]BRANCH-APP
t유형[fixed]event
ecEvent Category[fixed]BranchEvent
cid클라이언트 ID(discussed above, includes $google_analytics_client_id)AEBE52E7-03EE-455A-B3C4-E57283966239
uidUser ID$google_analytics_user_idUser A아니오
cnCampaign Nameutm_campaign or Branch campaign"Beaches and breezes"아니오
csCampaign Sourceutm_source or Branch channel"Twitter"아니오
cmCampaign Mediumutm_medium or Branch feature"480banner"아니오
ckCampaign Keywordsutm_term or Branch $keywords["Keyword1", "keyword3"]아니오
ccCampaign Contentutm_content or Branch tags"Some content"아니오
eaEvent Action (Name)event nameinstall
uipDevice IP AddressBranch SDK에서 수집111.111.111.111아니오
zCache buster[unix time + random number]1461878903666아니오

📘

익명 클라이언트 ID

If for some reason Branch does not receive an advertising identifier or hardware identifier, and you do not explicitly specify $google_analytics_user_id or $google_analytics_client_id, then Branch will send anonymous as the Client ID (cid). This is a required field by Google Analytics.

Troubleshooting

매우 짧거나 존재하지 않는 세션 길이

Branch에서 설치 및 오픈을 보내면 Google Analytics가 자동으로 세션을 시작합니다. 이 때문에 응용 프로그램을 시작할 때 새 세션을 생성하는 모든 코드를 제거해야 합니다. 예를 들어 iOS에서 다음과 같은 이벤트가 발생했을 수 있습니다.

[builder set:@"start" forKey:kGAISessionControl];

앱이 새 세션을 시작하지 않도록 이를 제거해야 합니다. 그렇지 않으면 세션 길이가 0초인 세션들이 발생하여 평균 세션 길이가 낮아져버릴 수 있습니다.

Google Analytics에 표시되지 않는 데이터

  1. Check your Measurement/Tracking ID in the Branch Dashboard matches the Measurement/Tracking ID in Google Analytics
  2. Google Analytics 대시보드의 오른쪽 부분을 보고 있는지 확인하십시오. 데이터는 다음에 나타나야 합니다 Acquisition > Sources > All
  3. Google Analytics Views에 필터가 없는지 확인하세요. 예를 들어 View가 영국의 유저를 필터링하고 Branch 오픈이 영국 유저에서 열린다면 View에 이 Branch 데이터가 표시되지 않습니다.