Airbridge supports integration with Google Analytics 4 (GA4). With the integration, you can send attribution data from Airbridge to GA4 and uncover insights into how users interact with your product in GA4.
Note
Only apps registered with GA4 can be integrated with Airbridge.
To implement the server-to-server integration, the App Instance ID of the Firebase Analytics SDK should be set as the device alias of the Airbridge SDK.
Airbridge Android SDK: v.2.19.5
Airbridge iOS SDK: v.1.18.0
Airbridge React Native SDK: v.1.5.0
Airbridge Flutter SDK: v.3.0.2
Airbridge Unity SDK: v.1.9.0
Attention
Once the SDK setup is complete, make sure to complete the required setup process in the Airbridge dashboard to implement the integration successfully.
Add the codes below to the Airbridge SDK. Without adding the codes, GA4 won't be properly integrated with Airbridge even if the necessary setup is completed in the Airbridge dashboard.
// MainApplication.java
@Override
public void onCreate() {
super.onCreate();
// Initialize Airbridge SDK
AirbridgeConfig config = new AirbridgeConfig.Builder("APP_NAME", "APP_TOKEN")
// Make Airbridge SDK explicitly start tracking
.setAutoStartTrackingEnabled(false)
.build();
Airbridge.init(this, config);
// Set device alias into Airbridge SDK
FirebaseAnalytics.getInstance(this).getAppInstanceId()
.addOnCompleteListener(new OnCompleteListener<String>() {
@Override
public void onComplete(@NonNull Task<String> task) {
String appInstanceId = task.getResult();
if (appInstanceId != null) {
Airbridge.setDeviceAlias("ga4_app_instance_id", appInstanceId);
}
// Explicitly start tracking
Airbridge.startTracking();
}
});
}
// MainApplication.kt
override fun onCreate() {
super.onCreate()
// Initialize Airbridge SDK
val config = AirbridgeConfig.Builder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN")
// Make Airbridge SDK explicitly start tracking
.setAutoStartTrackingEnabled(false)
.build()
Airbridge.init(this, config)
// Set device alias into Airbridge SDK
Firebase.analytics.appInstanceId.addOnCompleteListener { task ->
val appInstanceId: String? = task.result
if (appInstanceId != null) {
Airbridge.setDeviceAlias("ga4_app_instance_id", appInstanceId)
}
// Explicitly start tracking
Airbridge.startTracking()
}
}
import FirebaseAnalytics
// AppDelegate.swift
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?
) {
AirBridge.setAutoStartTrackingEnabled(false)
AirBridge.getInstance("YOUR_APP_SDK_TOKEN", appName:"YOUR_APP_NAME", withLaunchOptions:launchOptions)
if let appInstanceID = Analytics.appInstanceID() {
AirBridge.state()?.setDeviceAlias(key:"ga4_app_instance_id", value: appInstanceID)
}
// Explicitly start tracking
AirBridge.startTracking()
}
Set autoStartTrackingEnabled
to false
in the airbridge.json.
import analytics from '@react-native-firebase/analytics';
const appInstanceId = await analytics().getAppInstanceId();
Airbridge.state.setDeviceAlias("ga4_app_instance_id", appInstanceId);
Airbirdge.state.startTracking();
Set autoStartTrackingEnabled
to false
in the airbridge.json.
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
final appInstanceId = await FirebaseAnalytics.instance.appInstanceId;
if (appInstanceId != null) {
Airbridge.state.setDeviceAlias("ga4_app_instance_id", appInstanceId);
}
Airbridge.state.startTracking();
Set Auto Start Tracking Enabled
to false
in the project settings.
private async void SetupAirbridgeIntegration()
{
#if UNITY_ANDROID || UNITY_IOS
string appInstanceId = await Firebase.Analytics.FirebaseAnalytics.GetAnalyticsInstanceIdAsync();
AirbridgeUnity.SetDeviceAlias("ga4_app_instance_id", appInstanceId);
// ... (에어브릿지 연동 코드를 여기에 추가해주세요)
#endif
AirbridgeUnity.StartTracking();
}
The Airbridge dashboard setup must be completed to implement the integration. For detailed instructions, refer to the user guide below.
このページは役に立ちましたか?
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
final appInstanceId = await FirebaseAnalytics.instance.appInstanceId;
if (appInstanceId != null) {
Airbridge.state.setDeviceAlias("ga4_app_instance_id", appInstanceId);
}
Airbridge.state.startTracking();
private async void SetupAirbridgeIntegration()
{
#if UNITY_ANDROID || UNITY_IOS
string appInstanceId = await Firebase.Analytics.FirebaseAnalytics.GetAnalyticsInstanceIdAsync();
AirbridgeUnity.SetDeviceAlias("ga4_app_instance_id", appInstanceId);
// ... (에어브릿지 연동 코드를 여기에 추가해주세요)
#endif
AirbridgeUnity.StartTracking();
}