### Start Trial Event Tracking (C++) Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Tracks the initiation of a user trial for a service or product. This event includes a transaction ID, currency, the trial period (e.g., 'P1M' for one month), and details of the product associated with the trial. ```c FAirbridge::TrackEvent( AirbridgeCategory::START_TRIAL, UAirbridgeMap::CreateObject() ->Set(AirbridgeAttribute::TRANSACTION_ID, "ef1e5271-0370-407c-b1e9-669a8df1dc2c") ->Set(AirbridgeAttribute::CURRENCY, "USD") ->Set(AirbridgeAttribute::PERIOD, "P1M") ->Set(AirbridgeAttribute::PRODUCTS, UAirbridgeList::CreateObject() ->Add( UAirbridgeMap::CreateObject() ->Set(AirbridgeAttribute::PRODUCT_ID, "306a57cb-f653-4220-a208-8405d8e4d506") ->Set(AirbridgeAttribute::PRODUCT_NAME, "MusicStreamingMembership") ->Set(AirbridgeAttribute::PRODUCT_PRICE, 15) ->Set(AirbridgeAttribute::PRODUCT_CURRENCY, "USD") ) ) ); ``` -------------------------------- ### Create Tracking Links Launching App or Redirecting to App Store Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Demonstrates creating a tracking link using `FAirbridge::CreateTrackingLink`. This example configures the link to open a specific app scheme or redirect to the app store for iOS and Android, and a fallback webpage for desktop. It utilizes `OnSuccess` and `OnError` callbacks. ```c++ FAirbridge::CreateTrackingLink( TEXT("test_channel"), UAirbridgeMap::CreateObject() ->Set(AirbridgeTrackingLinkOption::CAMPAIGN, TEXT("test_campaign")) ->Set(AirbridgeTrackingLinkOption::DEEPLINK_URL, TEXT("YOUR_SCHEME://...")) ->Set(AirbridgeTrackingLinkOption::FALLBACK_IOS, TEXT("store")) ->Set(AirbridgeTrackingLinkOption::FALLBACK_ANDROID, TEXT("store")) ->Set(AirbridgeTrackingLinkOption::FALLBACK_DESKTOP, TEXT("https://example.com/")), [](const FAirbridgeTrackingLink& TrackingLink) { }, [](const FString& Error) { } ); ``` -------------------------------- ### Track Complete Tutorial Event in C++ Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Tracks the completion of a tutorial by the user, including an optional description. This helps in understanding user onboarding progress. ```c++ FAirbridge::TrackEvent( AirbridgeCategory::COMPLETE_TUTORIAL, UAirbridgeMap::CreateObject() ->Set(AirbridgeAttribute::DESCRIPTION, "Finish Initial Tutorial") ); ``` -------------------------------- ### Create Tracking Links Redirecting to Webpage Only Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Provides an example of creating a tracking link that redirects users solely to a webpage for iOS, Android, and Desktop. This configuration is useful when app-specific fallbacks are not required. ```c++ FAirbridge::CreateTrackingLink( TEXT("test_channel"), UAirbridgeMap::CreateObject() ->Set(AirbridgeTrackingLinkOption::CAMPAIGN, TEXT("test_campaign")) ->Set(AirbridgeTrackingLinkOption::FALLBACK_IOS, TEXT("https://example.com/")), ->Set(AirbridgeTrackingLinkOption::FALLBACK_ANDROID, TEXT("https://example.com/")), ->Set(AirbridgeTrackingLinkOption::FALLBACK_DESKTOP, TEXT("https://example.com/")), [](const FAirbridgeTrackingLink& TrackingLink) { }, [](const FString& Error) { } ); ``` -------------------------------- ### Install Airbridge iOS SDK with CocoaPods Source: https://help.airbridge.io/en/deeplink-developers/sdk-quickstart This snippet guides users on installing the Airbridge iOS SDK using CocoaPods. It includes commands for installing CocoaPods, initializing a Podfile, and adding the SDK as a dependency. Ensure 'User Script Sandboxing' is set to 'No' in Xcode build settings. ```shell brew install cocoapods pod init pod install --repo-update ``` ```ruby target '[Project Name]' do ... # Replace $HERE_LATEST_VERSION with latest version # - Versions: https://help.airbridge.io/developers/release-note-ios-sdk # - Example: pod 'airbridge-ios-sdk', '4.X.X' pod 'airbridge-ios-sdk', '$HERE_LATEST_VERSION' ... end ``` -------------------------------- ### Setup Deep Linking for Web SDK Source: https://help.airbridge.io/en/developers/sdk-quickstart Configures deep linking to redirect users from your website to your application. It specifies different destinations for users with and without the app installed, and provides fallback options. ```javascript airbridge.openDeeplink({ deeplinks: { ios: 'example://detail?id=1', android: 'example://detail?id=1', desktop: 'https://example.com/detail?id=1' }, fallbacks: { ios: 'itunes-appstore', // or 'https://example.com' android: 'google-play' // or 'https://example.com' } }) ``` -------------------------------- ### Start Tracking (C++) Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Initiates event tracking in the Airbridge SDK. This function should be called when user consent is obtained and tracking is desired, typically after disabling 'Auto Start Tracking'. ```c FAirbridge::StartTracking(); ``` -------------------------------- ### Install Airbridge Web SDK via Script Tag Source: https://help.airbridge.io/en/developers/sdk-quickstart Installs the Airbridge Web SDK by adding a script tag to the HTML's head section. This method automatically makes the `airbridge` object available globally. ```html ``` -------------------------------- ### Install Airbridge Web SDK via yarn Source: https://help.airbridge.io/en/developers/sdk-quickstart Installs the Airbridge Web SDK using yarn. After installation, the SDK can be imported into your JavaScript modules. ```bash yarn add airbridge-web-sdk-loader ``` -------------------------------- ### Stop Tracking (C++) Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Halts event tracking in the Airbridge SDK. This function is used to stop collecting events, usually when tracking is no longer needed or explicitly declined by the user, and typically after enabling 'Auto Start Tracking'. ```c FAirbridge::StopTracking(); ``` -------------------------------- ### Install Airbridge Web SDK via npm Source: https://help.airbridge.io/en/developers/sdk-quickstart Installs the Airbridge Web SDK using npm. After installation, the SDK can be imported into your JavaScript modules. ```bash npm install airbridge-web-sdk-loader ``` -------------------------------- ### Example Postback URL with Sample Data Source: https://help.airbridge.io/en/guides/airbridge-partner-registration Provides a concrete example of a postback URL with sample data populated for the macros. This illustrates how the URL appears after Airbridge has replaced the macros with specific event and attribution details. ```text https://api.example-ad-channel.com/postback/airbridge?touchpoint_id=e7580180-7f04-11e6-bdf4-0800200c9a66&ad_channel=sample_channel&event_timestamp=1479186394000&customID=4093721 ``` -------------------------------- ### Install Airbridge Web SDK via pnpm Source: https://help.airbridge.io/en/developers/sdk-quickstart Installs the Airbridge Web SDK using pnpm. After installation, the SDK can be imported into your JavaScript modules. ```bash pnpm install airbridge-web-sdk-loader ``` -------------------------------- ### TrackEvent Function Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 This section details the `Airbridge.TrackEvent` function used to send events from your application. It outlines the parameters, their types, and their requirements. ```APIDOC ## POST /trackEvent ### Description Sends an in-app event with optional semantic and custom attributes. ### Method POST ### Endpoint `/trackEvent` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **category** (String) - Required - The name or category of the event. - **semanticAttributes** (UAirbridgeMap) - Optional - Predefined attributes by Airbridge for reporting and analysis. - **customAttributes** (UAirbridgeMap) - Optional - User-defined attributes for custom tracking. ### Request Example ```json { "category": "airbridge.ecommerce.order.completed", "semanticAttributes": { "action": "Tool", "label": "Hammer", "value": 10, "currency": "USD", "products": [ { "product_id": 12345 } ], "totalQuantity": 1 }, "customAttributes": { "promotion": "FirstPurchasePromotion" } } ``` ### Response #### Success Response (200) Indicates the event was successfully queued for tracking. #### Response Example ```json { "status": "success", "message": "Event queued for tracking" } ``` ``` -------------------------------- ### Track Tutorial Completion with Airbridge SDK Source: https://help.airbridge.io/en/developers/android-sdk-v4 This example shows how to track the completion of a tutorial using the Airbridge SDK. It requires the 'COMPLETE_TUTORIAL' category and an optional description of the tutorial. The event data is passed as a map. ```kotlin Airbridge.trackEvent( AirbridgeCategory.COMPLETE_TUTORIAL, mapOf( AirbridgeAttribute.DESCRIPTION to "Finish Initial Tutorial", ) ) ``` ```java Airbridge.trackEvent( AirbridgeCategory.COMPLETE_TUTORIAL, new HashMap() {{ put(AirbridgeAttribute.DESCRIPTION, "Finish Initial Tutorial"); }} ); ``` -------------------------------- ### Get Huawei Install Referrer Details - Android SDK Source: https://help.airbridge.io/en/developers/fetching-guide-for-android-sdk Retrieves Huawei install referrer details using the Airbridge SDK. This function is asynchronous and provides results via a callback. It requires the Airbridge SDK to be initialized. ```kotlin import co.ab180.airbridge.Airbridge import co.ab180.airbridge.AirbridgeCallback import co.ab180.airbridge.ReferrerDetails Airbridge.getDeviceInfo().getHuaweiInstallReferrerDetails(object : AirbridgeCallback { override fun onSuccess(result: ReferrerDetails?) { } override fun onFailure(throwable: Throwable) { } override fun onComplete() { } }) ``` ```java import co.ab180.airbridge.Airbridge; import co.ab180.airbridge.AirbridgeCallback; import co.ab180.airbridge.ReferrerDetails; Airbridge.getDeviceInfo().getHuaweiInstallReferrerDetails(new AirbridgeCallback.SimpleCallback() { @Override public void onSuccess(ReferrerDetails details) { } @Override public void onFailure(Throwable throwable) { } }); ``` -------------------------------- ### Set and Manage User Information in C++ Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 This C++ code snippet demonstrates how to set and manage user information using the Airbridge SDK. It includes examples for setting user email and phone numbers (which are automatically hashed), adding and removing custom user attributes, and clearing all user attributes. Ensure the Airbridge SDK is correctly integrated into your project. ```cpp // Automatically hashed on client side using SHA256 // Can turn off hashing feature with special flag FAirbridge::SetUserEmail("testID@ab180.co"); FAirbridge::SetUserPhone("821012341234"); // Attributes FAirbridge::SetUserAttribute("ADD_YOUR_KEY", 1); FAirbridge::SetUserAttribute("ADD_YOUR_KEY", 1L); FAirbridge::SetUserAttribute("ADD_YOUR_KEY", 1f); FAirbridge::SetUserAttribute("ADD_YOUR_KEY", 1.0); FAirbridge::SetUserAttribute("ADD_YOUR_KEY", "1"); FAirbridge::SetUserAttribute("ADD_YOUR_KEY", true); FAirbridge::RemoveUserAttribute("DELETE_THIS_KEY"); FAirbridge::ClearUserAttributes(); ``` -------------------------------- ### Track Start Trial Event in C# Source: https://help.airbridge.io/en/developers/unity-sdk-v4 This C# code snippet shows how to track a 'Start Trial' event using the Airbridge SDK. It includes transaction ID, currency, trial period, and product details. Ensure the Airbridge SDK is initialized before use. ```csharp Airbridge.TrackEvent( category: AirbridgeCategory.START_TRIAL, semanticAttributes: new Dictionary() { { AirbridgeAttribute.TRANSACTION_ID, "ef1e5271-0370-407c-b1e9-669a8df1dc2c" }, { AirbridgeAttribute.CURRENCY, "USD" }, { AirbridgeAttribute.PERIOD, "P1M" }, { AirbridgeAttribute.PRODUCTS, new List() { new Dictionary() { { AirbridgeAttribute.PRODUCT_ID, "306a57cb-f653-4220-a208-8405d8e4d506" }, { AirbridgeAttribute.PRODUCT_NAME, "MusicStreamingMembership" }, { AirbridgeAttribute.PRODUCT_PRICE, 15 }, { AirbridgeAttribute.PRODUCT_CURRENCY, "USD" }, }, } } } ); ``` -------------------------------- ### Configure Re-engagement Parameter for Tracking Links Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 Defines the 'AirbridgeTrackingLinkOption::IS_REENGAGEMENT' parameter for tracking links. It offers three states: 'off' (default, attributes to installs and post-installs), 'on_true' (for re-engagement, attributes to deeplink opens and in-app events, not installs), and 'on_false' (for user acquisition, attributes to installs and in-app events, not deeplink opens). ```c++ AirbridgeTrackingLinkOption::IS_REENGAGEMENT | ("off" | "on_true" | "on_false") ``` -------------------------------- ### Track Start Trial Event with Airbridge SDK Source: https://help.airbridge.io/en/developers/android-sdk-v4 This code demonstrates how to track a 'Start Trial' event using the Airbridge SDK. It includes key information such as transaction ID, currency, trial period, and product details. This is valuable for understanding user acquisition and trial conversion rates. ```kotlin Airbridge.trackEvent( AirbridgeCategory.START_TRIAL, mapOf( AirbridgeAttribute.TRANSACTION_ID to "ef1e5271-0370-407c-b1e9-669a8df1dc2c", AirbridgeAttribute.CURRENCY to "USD", AirbridgeAttribute.PERIOD to "P1M", AirbridgeAttribute.PRODUCTS to listOf( mapOf( AirbridgeAttribute.PRODUCT_ID to "306a57cb-f653-4220-a208-8405d8e4d506", AirbridgeAttribute.PRODUCT_NAME to "MusicStreamingMemebership", AirbridgeAttribute.PRODUCT_PRICE to 15, AirbridgeAttribute.PRODUCT_CURRENCY to "USD", ), ), ) ) ``` ```java Airbridge.trackEvent( AirbridgeCategory.START_TRIAL, new HashMap() {{ put(AirbridgeAttribute.TRANSACTION_ID, "ef1e5271-0370-407c-b1e9-669a8df1dc2c"); put(AirbridgeAttribute.CURRENCY, "USD"); put(AirbridgeAttribute.PERIOD, "P1M"); put(AirbridgeAttribute.PRODUCTS, Arrays.asList( new HashMap() {{ put(AirbridgeAttribute.PRODUCT_ID, "306a57cb-f653-4220-a208-8405d8e4d506"); put(AirbridgeAttribute.PRODUCT_NAME, "MusicStreamingMemebership"); put(AirbridgeAttribute.PRODUCT_PRICE, 15); put(AirbridgeAttribute.PRODUCT_CURRENCY, "USD"); }}, )); }} ); ``` -------------------------------- ### Add AirbridgeUnreal Dependency to Build.cs (C#) Source: https://help.airbridge.io/en/developers/unreal-sdk-v4 This code snippet demonstrates how to add the 'AirbridgeUnreal' module to the PublicDependencyModuleNames array in your Unreal Engine project's Build.cs file. This is a required step after installing the SDK to ensure it is properly linked. ```csharp public class : ModuleRules { public (ReadOnlyTargetRules Target) : base(Target) { ... PublicDependencyModuleNames.AddRange(new string[] { ... , "AirbridgeUnreal" }); // ADD DEPENDENCY ... } } ``` -------------------------------- ### Track Tutorial Completion with Airbridge SDK (C#) Source: https://help.airbridge.io/en/developers/unity-sdk-v4 This C# code snippet illustrates how to track the completion of a tutorial using the Airbridge SDK. It utilizes the `COMPLETE_TUTORIAL` category and includes a descriptive attribute for clarity. This is essential for monitoring user onboarding success. ```csharp Airbridge.TrackEvent( category: AirbridgeCategory.COMPLETE_TUTORIAL, semanticAttributes: new Dictionary() { { AirbridgeAttribute.DESCRIPTION, "Finish Initial Tutorial" }, } ); ``` -------------------------------- ### Get Google Install Referrer Details - Android SDK (Previous) Source: https://help.airbridge.io/en/developers/fetching-guide-for-android-sdk Fetches Google Install Referrer details using the previous version of the Airbridge Android SDK. It employs an AirbridgeCallback to manage the asynchronous results, including success, failure, and completion. ```kotlin import co.ab180.airbridge.Airbridge import co.ab180.airbridge.AirbridgeCallback import co.ab180.airbridge.ReferrerDetails Airbridge.getDeviceInfo().getGoogleInstallReferrerDetails(object : AirbridgeCallback { override fun onSuccess(result: ReferrerDetails?) { } override fun onFailure(throwable: Throwable) { } override fun onComplete() { } }) ``` ```java import co.ab180.airbridge.Airbridge; import co.ab180.airbridge.AirbridgeCallback; import co.ab180.airbridge.ReferrerDetails; Airbridge.getDeviceInfo().getGoogleInstallReferrerDetails(new AirbridgeCallback.SimpleCallback() { @Override public void onSuccess(ReferrerDetails details) { } @Override public void onFailure(Throwable throwable) { } }); ``` -------------------------------- ### Track Tutorial Completion with Airbridge SDK Source: https://help.airbridge.io/en/developers/ios-sdk-v4 This snippet demonstrates tracking the completion of a tutorial using the Airbridge SDK. It requires the Airbridge SDK and uses the COMPLETE_TUTORIAL category. A description attribute is included to provide context for the event. ```swift import Airbridge ... Airbridge.trackEvent( category: AirbridgeCategory.COMPLETE_TUTORIAL, semanticAttributes: [ AirbridgeAttribute.DESCRIPTION: "Finish Initial Tutorial", ] ) ``` ```objective-c #import ... [Airbridge trackEventWithCategory:AirbridgeCategory.COMPLETE_TUTORIAL semanticAttributes:@{ AirbridgeAttribute.DESCRIPTION: @"Finish Initial Tutorial", }]; ``` -------------------------------- ### Track Start Trial Event with Airbridge SDK Source: https://help.airbridge.io/en/developers/cordova-sdk-v4 Tracks the 'start trial' event, which is used when a user begins a free trial period. It includes transaction ID, currency, trial period duration, and product details. This helps in understanding trial adoption. ```typescript Airbridge.trackEvent( AirbridgeCategory.START_TRIAL, { [AirbridgeAttribute.TRANSACTION_ID]: 'ef1e5271-0370-407c-b1e9-669a8df1dc2c', [AirbridgeAttribute.CURRENCY]: 'USD', [AirbridgeAttribute.PERIOD]: 'P1M', [AirbridgeAttribute.PRODUCTS]: [ { [AirbridgeAttribute.PRODUCT_ID]: '306a57cb-f653-4220-a208-8405d8e4d506', [AirbridgeAttribute.PRODUCT_NAME]: 'MusicStreamingMemebership', [AirbridgeAttribute.PRODUCT_PRICE]: 15, [AirbridgeAttribute.PRODUCT_CURRENCY]: 'USD', }, ], }, ) ``` -------------------------------- ### Get One Store Install Referrer Details - Android SDK Source: https://help.airbridge.io/en/developers/fetching-guide-for-android-sdk Retrieves One Store install referrer details using the Airbridge SDK. This function is asynchronous and provides results via a callback. Note that Android SDK v4 does not support this feature. ```kotlin import co.ab180.airbridge.Airbridge import co.ab180.airbridge.AirbridgeCallback import co.ab180.airbridge.ReferrerDetails Airbridge.getDeviceInfo().getOneStoreInstallReferrerDetails(object : AirbridgeCallback { override fun onSuccess(result: ReferrerDetails?) { } override fun onFailure(throwable: Throwable) { } override fun onComplete() { } }) ``` ```java import co.ab180.airbridge.Airbridge; import co.ab180.airbridge.AirbridgeCallback; import co.ab180.airbridge.ReferrerDetails; Airbridge.getDeviceInfo().getOneStoreInstallReferrerDetails(new AirbridgeCallback.SimpleCallback() { @Override public void onSuccess(ReferrerDetails details) { } @Override public void onFailure(Throwable throwable) { } }); ``` -------------------------------- ### Create Tracking Links to Launch App or Redirect to App Store using C# Source: https://help.airbridge.io/en/developers/unity-sdk-v4 Demonstrates how to create tracking links using the Airbridge SDK in C#. This specific example configures the link to launch the app via a deep link URL or redirect to the app store if the app is not installed. It includes options for campaign, deep link URL, and fallback URLs for different platforms. ```csharp Airbridge.CreateTrackingLink( channel: "test_channel", option: new Dictionary { { AirbridgeTrackingLinkOption.CAMPAIGN, "test_campaign" }, { AirbridgeTrackingLinkOption.DEEPLINK_URL, "YOUR_SCHEME://..." }, { AirbridgeTrackingLinkOption.FALLBACK_IOS, "store" }, { AirbridgeTrackingLinkOption.FALLBACK_ANDROID, "store" }, { AirbridgeTrackingLinkOption.FALLBACK_DESKTOP, "https://example.com/" } }, onSuccess: trackingLink => { }, onFailure: exception => { } ); ``` -------------------------------- ### Track Sign Up Event using Airbridge SDK (C#) Source: https://help.airbridge.io/en/developers/unity-sdk-v4 This code example shows how to track a 'Sign Up' event using the Airbridge SDK. It includes setting user identification details like User ID, Alias, Email, Phone, and attributes before tracking the standard 'SIGN_UP' event. ```csharp Airbridge.SetUserID("string"); Airbridge.SetUserAlias("string", "string"); Airbridge.SetUserEmail("string"); Airbridge.SetUserPhone("string"); Airbridge.SetUserAttribute("string", "string"); Airbridge.TrackEvent(AirbridgeCategory.SIGN_UP); ``` -------------------------------- ### Import Airbridge SDK in Ionic Projects Source: https://help.airbridge.io/en/developers/cordova-ionic-sdk Example of importing the Airbridge SDK into TypeScript files for Ionic projects. This makes the Airbridge object available for use within the application. ```typescript import ... ... declare let Airbridge: any; ... ``` -------------------------------- ### Clear All User Data with Airbridge SDK Source: https://help.airbridge.io/en/developers/cordova-sdk-v4 Resets all user information tracked by the Airbridge SDK. This function is useful for clearing sensitive data or starting fresh user tracking. ```typescript Airbridge.clearUser() ``` -------------------------------- ### Create and Initialize Independent Airbridge SDK Instance (Kotlin) Source: https://help.airbridge.io/en/developers/android-sdk-v4 Demonstrates how to create a custom, independent instance of the Airbridge SDK using `AirbridgeInterface` and initialize it with provided app name and SDK token. This allows for multi-tenant support within a single application. ```Kotlin object CustomInstance: AirbridgeInterface() val option = AirbridgeOptionBuilder("YOUR_APP_NAME", "YOUR_APP_SDK_TOKEN") .build() CustomInstance.initializeSDK(this, option) ```