我已经实施了 3 个步骤。
第 1 步:我已经下载了谷歌分析库文件并将这些文件添加到项目中,
- GAI.h
- GAITrackedViewController.h
- GAITracker.h
- GAITransaction.h
GAITransactionItem.h
libGoogleAnalytics.a
- CoreData.framework
- SystemConfiguration.framework
第2步:添加此代码didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[UIApplication sharedApplication].statusBarHidden = NO;
[GAI sharedInstance].trackUncaughtExceptions = YES;
[GAI sharedInstance].dispatchInterval = 2;
[GAI sharedInstance].debug=YES;
[[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-1"];
return YES;
}
第 3 步:在我HomeScreen
写的启动图像后加载的视图中,我已将此标头更新为:
#import "GAITrackedViewController.h"
@interface BTSHomeViewController : GAITrackedViewController
并且在BTSHomeViewController.m
- (void)viewDidLoad
{ ...
self.trackedViewName = @"Home";
}
注意:我只写self.trackedViewName = @"Home";
在首页而不是所有页面中是否有必要写在所有页面中?
LOG 也显示此警告:
ld: warning: directory not found for option '-L/Users/Supriya/Desktop/BTS with Analytics/BTS 2.1/BTS/BTS/GoogleAnalytics/Library'
ld: warning: directory not found for option '-F/Users/Supriya/Desktop/BTS with Analytics/BTS 2.1/BTS/../../Documents'
ld: warning: directory not found for option '-F/Users/Supriya/Desktop/BTS with Analytics/BTS 2.1/BTS/../../../Documents'
当我在设备中运行我的代码后,谷歌分析没有显示任何活跃用户。
这是我项目中框架文件夹的快照,我忘记添加任何库了吗?
: 请帮忙,是什么错误?
提前致谢。