Getting Mobile App Installation Source
If you want to start tracking the source a user installed a mobile app from, for example, to evaluate the efficiency of a promotion campaign and build further communication based on this data, just follow this guide:
- Add the AppsFlyer library
pod 'AppsFlyerFramework'-
Integrate AppsFlyer into your project by following the instructions.
-
In Signing & Capabilities, add the subdomain to the Associated Domains section. Make sure the subdomain is created as part of the template setup process.
-
Implement
onConversionDataSuccessfrom the AppsFlyerLibDelegate protocol.
This method is called on the first app install attributed to a link and provides key user attribution data, including install details, the media source, and the campaign.Use the sample code below as a template for your implementation.
func onConversionDataSuccess(_ data: [AnyHashable: Any]) { print("onConversionDataSuccess data:") for (key, value) in data { print(key, ":", value) } if let status = data["af_status"] as? String { if status == "Non-organic" { if let sourceID = data["media_source"], let campaign = data["campaign"] { print("This is a Non-Organic install. Media source: \(sourceID) Campaign: \(campaign)") } } else { print("This is an organic install.") } if let is_first_launch = data["is_first_launch"] as? Bool, is_first_launch { print("First Launch") } else { print("Not First Launch") } } } -
Create a method or ask your Maestra Forward Deployed Marketer to create a method to trigger an action and/or populate a custom field.
-
Send the resulting
sourceIDstring to the action’s custom field in Maestra.
Mindbox.shared.executeAsyncOperation(operationSystemName:"<operationSystemName>" json: "{<Request Body with the Retrieved sourceId>}")Updated 16 days ago

