iphone - 谷歌分析不工作 iOS

标签 iphone ios ipad core-data google-analytics

我已经实现了 3 个步骤。

第 1 步:我已下载谷歌分析库文件并将此文件添加到项目中,

  • GAI.h
  • GAITrackedViewController.h
  • GAITracker.h
  • GAITransaction.h
  • GAITransactionItem.h

  • libGoogleAnalytics.a

  • 核心数据框架
  • 系统配置.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 View 中,启动图像后加载 我写这个, 我已将此 header 更新为:

#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'

当我在设备中运行我的代码时写完这个之后,谷歌分析没有显示任何活跃用户。

这是我项目中框架文件夹的快照,我是不是忘记添加任何库了?

: 请帮忙,这是什么错误?

提前致谢。

最佳答案

  1. 只是为了确认一下,但是您已经为移动应用程序使用了跟踪 ID,对吧?为网络应用程序创建的跟踪 ID 在移动应用程序中使用时不会为您提供任何信息。

  2. 一旦在 App Delegate 中完成了初始设置,就可以像这样轻松地完成跟踪 - [[[GAI sharedInstance] defaultTracker] trackView:@"Screen name"];

关于iphone - 谷歌分析不工作 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18593820/

相关文章:

iphone - iOS/iPhone——如何在与断开连接的玩家的比赛中实现电脑玩家(随机 Actor )?

iPad 企业分发选项

ios - 当我们从 View 中删除第三个按钮时,我们如何增加两个按钮的宽度

ios - UIView 的框架大小问题

iphone - 有没有获取全局当前时间的API

ios - 更改 TabBar SwiftUI 中的选项卡选择颜色

javascript - window.opener 为空(iOS 12.3.1 Safari 和 Chrome)

ios - Xcode 5 与 iOS 6 SDK : 'UIAccelerometer' is unavailable: not available on OS X

ios - 调整 iPad 键盘拆分时的 UIPopover

iphone - 苹果新验证 Controller 的异步部分是必须的吗?