【发布时间】:2017-08-19 19:40:21
【问题描述】:
是否有任何方法可以以编程方式跟踪在 iOS/Swift 中点击的谷歌广告。我没有找到任何解决方案来使用 Google Ad Sense 跟踪点击任何 Google 广告的点击次数。
【问题讨论】:
-
有一个应用程序叫做“AdSense”。还是您的意思是您想以编程方式进行?
-
以编程方式。
是否有任何方法可以以编程方式跟踪在 iOS/Swift 中点击的谷歌广告。我没有找到任何解决方案来使用 Google Ad Sense 跟踪点击任何 Google 广告的点击次数。
【问题讨论】:
阅读documentation - 有委托功能。我认为您可以像这样实现它:
我建议你将类范围变量 clickCount = 0 并在委托函数中添加一个。
/// Tells the delegate that a full screen view will be presented in response
/// to the user clicking on an ad.
func adViewWillPresentScreen(_ bannerView: GADBannerView) {
clickCount += 1
print(clickCount)
}
【讨论】: