Is it possible to track click throughs from iPhone Smart Banner

后端 未结 4 1033
無奈伤痛
無奈伤痛 2021-01-30 22:52

We want to be able to track, using Google Analytics, any click throughs from the iPhone Smart Banner that we have added to our website.

The meta code used to add the sma

4条回答
  •  遥遥无期
    2021-01-30 23:17

    I think you will need to track this from the app rather than from the website. If you have implemented the application:openURL:sourceApplication:annotation: method in your app delegate then you should be able to send an event to google analytics from within that method.

    - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
    {
        [tracker sendEventWithCategory:@"uiAction"
                            withAction:@"openFromSmartBanner"
                             withLabel:[NSString stringWithFormat@"%@",[url absoluteString]
                             withValue:nil];
        return YES;
    }
    

    This will trigger every time your app is opened from a smart banner and tell you what url it came from (if available from multiple websites). This will only give you clicks when the smart banner shows open button not when it shows view

提交回复
热议问题