WebViews

WebViews are used to show HTML content of websites inside a mobile application. Because the HTML website is technically not part of the mobile application source code, content and user behavior inside the HTML content cannot be tracked by the SDK. Instead, you can use our pixel (v4, Tag Integration, or SmartPixel) to track user behavior in your WebViews. The pixel can then send the information to the SDK to guarantee streamline tracking.

When using WebView tracking as described in this documentation, the user stays in the app context during the entire visit. The pixel sends the tracked data back to the SDK where the SDK uses the known user and system information. There is no session break or change in path navigation.

Known Limitations

The Mapp Intelligence iOS SDKv5 relies on the WKWebView object to pass information in between the Mapp Intelligence Pixel and the SDK. With the current technical limitations, the Mapp Intelligence iOS SDK only supports WebView tracking for the following operating system:

  • iOS 10.0+

WKWebView is part of the WebKit framework. WebView tracking with Intelligence is only compatible with the previously mentioned framework. If you are using the SFSafariViewController of the SafariServices framework for your WebViews, tracking will not work.

Example iOS

Please note that custom parameters are optional in the request.

  1. First, define the web view configuration and URL you want to track:

    let request = URLRequest(url: URL(string: "http://demoshop.mapp.com/web2app/index.html")!)
             
    let configuration = WKWebViewConfiguration()
    JAVA
  2. Call the MIWebViewTracker update method

    MIWebViewTracker.sharedInstance()?.update(configuration)
    JAVA

Full Code Example:

override func viewDidLoad() {
    super.viewDidLoad()
 
    let request = URLRequest(url: URL(string: "http://demoshop.mapp.com/web2app/index.html")!)
         
    let configuration = WKWebViewConfiguration()
    MIWebViewTracker.sharedInstance()?.update(configuration)
                 
    let webView = WKWebView(frame: self.view.frame, configuration: configuration)
    self.view.addSubview(webView)
    webView.load(request)
}
JAVA
  1. First, define the web view configuration and URL you want to track:

    NSURLRequest* request = [[NSURLRequest alloc] initWithURL: [[NSURL alloc] initWithString:@"http://demoshop.mapp.com/web2app/index.html"]];
         
    WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
    JAVA
  2. Call the MIWebViewTracker update method

    [[MIWebViewTracker sharedInstance] updateConfiguration:configuration];
    JAVA

Full Code Example:

-(void)testWebView {
    NSURLRequest* request = [[NSURLRequest alloc] initWithURL: [[NSURL alloc] initWithString:@"http://demoshop.mapp.com/web2app/index.html"]];
     
    WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init];
    [[MIWebViewTracker sharedInstance] updateConfiguration:configuration];
     
    WKWebView* webView = [[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration];
    [webView loadRequest:request];
}
JAVA



Cookie Notice

We use technically neccessary cookies. For details, please have a look at:
mapp.com/privacy

OK Don't track me.