You can attribute an app open to a marketing campaign by passing the deep link the user followed (Universal Link or custom URL scheme) to the SDK. The SDK reads campaign parameters from the URL query and attaches them to the next page request.
Method
Method | Description |
|---|---|
| Parses campaign parameters from a URL and stores them. They are attached to the next page event that does not already carry campaign parameters. If |
Example: handle Universal Links via SceneDelegate
@available(iOS 13.0, *)
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
MappIntelligence.shared()?.trackUrl(userActivity.webpageURL, withMediaCode: nil)
}
}- (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivity {
if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
[[MappIntelligence shared] trackUrl:userActivity.webpageURL withMediaCode:nil];
}
}Example: handle a custom URL scheme
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
MappIntelligence.shared()?.trackUrl(url, withMediaCode: nil)
return true
}- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
[[MappIntelligence shared] trackUrl:url withMediaCode:nil];
return YES;
}The campaign parameters parsed from the URL are stored and attached to the next page request that does not already carry its own campaign parameters.