简体   繁体   English

Google Analytics(分析)iOS版跟踪同一事件的多个帐户

[英]Google Analytics for iOS track to multiple account for same event

I have two different web property id from two different accounts, say UA-1111-11, UA-2222-22 Now, in my iOS app, I need to log to both of them in the events. 我有来自两个不同帐户的两个不同的网络媒体资源ID,例如UA-1111-11,UA-2222-22。现在,在我的iOS应用中,我需要在事件中登录到两个帐户。 Is this even possible? 这有可能吗? If not, is there any workaround? 如果没有,是否有任何解决方法?

Here is my high level scenario: I have an existing app where I use google analytics UA-1111-11 to track. 这是我的高级方案:我有一个现有的应用程序,在其中使用Google Analytics(分析)UA-1111-11进行跟踪。 Now, I had an agreement with company X (they have UA-2222-22). 现在,我与X公司(他们拥有UA-2222-22)达成了协议。 They told me that I need to send analytics tracking events to their account (UA-2222-22) from my app (and I want to keep UA-1111-11 for my own use). 他们告诉我,我需要从我的应用程序向他们的帐户(UA-2222-22)发送分析跟踪事件(我想保留UA-1111-11供我自己使用)。

Google is working on their v2 SDK for iOS and Android, and they added a feature for multiple trackers in the same application. Google正在开发适用于iOS和Android的v2 SDK ,并在同一应用程序中为多个跟踪器添加了一项功能。 Currently, you can download Google Analytics v2 beta 3 for iOS, and start playing with it . 目前,您可以下载适用于iOS的Google Analytics(分析)v2 beta 3,然后开始使用它

Check Google Analytics SDK 检查Google Analytics(分析)SDK

Sample code: 样例代码:

#import "RootViewController.h"
#import "GAI.h"

@interface RootViewController ()

@end

@implementation RootViewController
{
- (void)viewDidLoad {
  [super viewDidLoad];

  // Send a screen view to the first property.
  id tracker1 = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Y"];
  [tracker1 sendView:@"/HomeScreen"];

  // Send another screen view to the second property.
  id tracker2 = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-Z"];
  [tracker2 sendView:@"Home"];
}

@end

Keep in mind that automated measurement features, like automatic screen and uncaught exception measurement, will only use one tracker to send data to Google Analytics. 请记住,自动测量功能(例如自动屏幕和未捕获的异常测量)将仅使用一个跟踪器将数据发送到Google Analytics(分析)。 If you are using these features and want to send data using other trackers, you will need to do so manually. 如果您正在使用这些功能,并希望使用其他跟踪器发送数据,则需要手动进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM