当用户输入搜索查询时,我想跟踪:
1)他们的搜索词
2) 返回结果数
3) CFUUID
有人能告诉我是否可以将所有这些参数放入 1 个字典中,还是我需要为每个键/值创建一个单独的字典?
我可以这样做吗:
NSDictionary *flurryDict =
[NSDictionary dictionaryWithObjectsAndKeys:searchText,@"Search Term",numResults,@"Results Returned",nil];
[FlurryAnalytics logEvent:@"USER_SEARCH" withParameters:flurryDict];
这是我到目前为止所拥有的:
//View Controller
if([searchText length] >=3){
NSLog(@"Search: %@",searchText);
NSLog(@"Search Results: %i",[self.filteredListContent count]);
NSLog(@"Device UUID: %@",[sharedLabelManager myUUID]);
//Send to Flurry
NSDictionary *flurryDict =
[NSDictionary dictionaryWithObjectsAndKeys:@"Search Term", searchText, nil];
[FlurryAnalytics logEvent:@"SEARCH" withParameters:flurryDict];
}
最佳答案
是的。字典是一组键和值,像下面这样的东西就可以了:
NSString *uuid = [sharedLabelManaged myUUID];
NSNumber *totalResults = [NSNumber numberWithInt:self.filteredListContent.count];
NSDictionary *flurryDict = [NSDictionary dictionaryWithObjectsAndKeys:searchText, @"SearchTerm", totalResults, @"SearchResultsCount", uuid, @"UUID", nil];
[FlurryAnalytics logEvent:@"SEARCH" withParameters:flurryDict];
关于ios5 - 使用 FlurryAnalytics 日志事件 :withParameters,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9786833/