简体   繁体   English

iOS上的Google Analytics(分析)SDK v2中未报告的广告系列

[英]Campaigns not reported in Google Analytics SDK v2 on iOS

I've integrated Google Analytics SDK v2 on both Android and iOS and I am stuck on a campaign issue only with the iOS version of the SDK. 我已经在Android和iOS上集成了Google Analytics(分析)SDK v2,并且仅在iOS版本的SDK上遇到了广告系列问题。 The setCampaignUrl works great on Android but completely does not report anything on a iPhone. setCampaignUrl在Android上运行良好,但在iPhone上完全不报告任何内容。

The tracker is correctly initialized since all the other methods are working correctly on iOS and I am doing it like the following: 跟踪器已正确初始化,因为所有其他方法在iOS上均能正常工作 ,我正在执行以下操作:

id<GAITracker> tracker = [GAI sharedInstance].defaultTracker;
    if (tracker) {
        tracker.campaignUrl = [NSString stringWithCString:campaignUrl encoding:NSUTF8StringEncoding];
    }

I've also tried setCampaignUrl:campaignUrl without success. 我也尝试了setCampaignUrl:campaignUrl,但没有成功。

The campaign URL is the one given as example on Google Analytics web site ("utm_campaign=my_campaign&utm_source=google&utm_medium=cpc&utm_term=my_keyword&utm_content=ad_variation1") and do the job on Android. 广告系列网址是Google Analytics(分析)网站上的示例网址(“ utm_campaign = my_campaign&utm_source = google&utm_medium = cpc&utm_term = my_keyword&utm_content = ad_variation1”),并在Android上完成。

Am I correctly using it, have you encountered a similar issue? 我使用正确吗,您遇到过类似的问题吗? Could it be a Analytics SDK issue? 可能是Google Analytics(分析)SDK问题吗?

Other developers reported the same issue on a Google group thread ( http://productforums.google.com/forum/#!topic/analytics/sbUOYuhaMc8 ) which might mean that it could be a Google issue. 其他开发人员在Google网上论坛线程( http://productforums.google.com/forum/#!topic/analytics/sbUOYuhaMc8 )上报告了相同的问题,这可能意味着这可能是Google的问题。

Thanks for your help. 谢谢你的帮助。

Found the solution, the documentation on Google Analytics web site is wrong in the iOS part : 找到解决方案后, iOS部分中 Google Analytics(分析)网站上的文档有误:

The campaign URL given as example on Google Analytics web site ("utm_campaign=my_campaign&utm_source=google&utm_medium=cpc&utm_term=my_keyword&utm_content=ad_variation1") do the job on Android but on iOS it has to be a well formatted web url such as: 在Google Analytics(分析)网站上作为示例提供的广告系列网址(“ utm_campaign = my_campaign&utm_source = google&utm_medium = cpc&utm_term = my_keyword&utm_content = ad_variation1”)在Android 上可以完成这项工作,但在iOS上,它必须是格式正确的网络url,例如:

http://www.google.com?utm_campaign=my_campaign&utm_source=google&utm_medium=cpc&utm_term=my_keyword&utm_content=ad_variation1 http://www.google.com?utm_campaign=my_campaign&utm_source=google&utm_medium=cpc&utm_term=my_keyword&utm_content=ad_variation1

to be reported on Analytics. 在Google Analytics(分析)上报告。 They are certainly using a regex because any random site name would work and be careful, the site cannot contain "/" after the ".com" 他们肯定使用了正则表达式,因为任何随机站点名称都可以使用并且要小心,该站点在“ .com”之后不能包含“ /”。

Same for setReferrerUrl:referrer you cannot use a string like "google.com" or "myOtherApp" as mentionned by Google but instead a valid url such as " http://www.google.com " or " http://test.com/2 " setReferrerUrl:referrer相同,您不能使用Google提到的字符串“ google.com”或“ myOtherApp”,而是有效的网址,例如“ http://www.google.com ”或“ http:// test”。 com / 2

Hope it helps 希望能帮助到你

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

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