我正在尝试将GA的用户ID功能链接到我的iOS应用程序,但这似乎不起作用.从文档中,我启用了具有User ID功能的视图(配置文件).然后,我设置userId字段.
我的代码:AppDelegate.m
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
// You only need to set User ID on a tracker once. By setting it on the tracker, the ID will be
// sent with all subsequent hits.
[tracker set:@"&uid"
value:@"userIDTest"];
// This hit will be sent with the User ID value and be visible in User-ID-enabled views (profiles).
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"User Test" // Event category (required)
action:@"User Sign In" // Event action (required)
label:nil // Event label
value:nil] build]]; // …Run Code Online (Sandbox Code Playgroud)