Google Analytics(分析)无法使用iOS [英] Google analytics not working iOS
问题描述
我已经实施了3个步骤。
步骤1:我已下载google analytics Library文件并将此文件添加到项目, p>
- 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 =
[GAI sharedInstance] .trackUncaughtExceptions = YES;
[GAI sharedInstance] .dispatchInterval = 2;
[GAI sharedInstance] .debug = YES;
[[GAI sharedInstance] trackerWithTrackingId:@UA-XXXX-1];
return YES;
}
步骤3: c> HomeScreen 查看在启动后加载的映像
i写这个,
我已经更新这个头到:
#importGAITrackedViewController.h
@interface BTSHomeViewController:GAITrackedViewController
和 BTSHomeViewController.m
(void)viewDidLoad
{...
self.trackedViewName = @Home;
}
/em>self.trackedViewName = @Home;
只在第一页而不是在所有页面都需要写入所有页面?
也显示此警告:
ld:warning:使用Google Analytics(分析)/ BTS的用户/ Supriya / Desktop / BTS 2.1 / BTS / BTS / GoogleAnalytics / Library'
ld:warning:没有找到与选项'-F / Users / Supriya / Desktop / /BTS/../../Documents'
ld:warning:没有找到使用Analytics / BTS 2.1 / BTS /../../的选项'-F / Users / Supriya / Desktop / BTS的目录。 ./Documents'
在设备上运行我的代码后,任何活动用户。
这是我的项目中我的框架文件夹的快照,我忘记添加任何库了吗?
:
请帮助,错误是什么?
-
只是要确认,但您已经为移动应用使用了跟踪ID?
-
在应用程式代表中完成初始设定后,跟踪可以很容易地做这样的事情 -
[[[GAI sharedInstance] defaultTracker] trackView:@屏幕名称];
I have implemented 3 steps.
Step 1: I have Downloaded google analytics Library files and added this files to project,
- GAI.h
- GAITrackedViewController.h
- GAITracker.h
- GAITransaction.h
GAITransactionItem.h
libGoogleAnalytics.a
- CoreData.framework
- SystemConfiguration.framework
Step 2: Added this code in 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;
}
Step 3: In my HomeScreen
view which loads after launch image
i wrote this,
I have updated this header to:
#import "GAITrackedViewController.h"
@interface BTSHomeViewController : GAITrackedViewController
and in BTSHomeViewController.m
- (void)viewDidLoad
{ ...
self.trackedViewName = @"Home";
}
Note: I have wroteself.trackedViewName = @"Home";
only on firstpage not in all the Pages it is necessary to write in all pages ?
also LOG shows this warning:
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'
After writing this when i run my code in Device, google analytics doesn't show any active users.
Here is the snapshot of my framework folder in my project, am i forgetting adding any library ?
: Please help, what is the mistake ?
Thanks in advance.
Just to confirm, but you have used a tracking ID for a mobile app right? A tracking ID created for a web application will not give you anything when used in a mobile app.
Once the initial set-up is done in App Delegate, tracking can just as easily be done with something like this -
[[[GAI sharedInstance] defaultTracker] trackView:@"Screen name"];
这篇关于Google Analytics(分析)无法使用iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!