如何以编程方式跟踪 Google Adsense 在 iOS / Swift 中的点击

How to track Google Adsense Click in iOS / Swift Programatically

是否有任何方法可以跟踪 google 广告在 iOS/Swift 中以编程方式被点击。我没有找到任何使用 Google Ad Sense 跟踪点击任何 google 广告的点击次数的解决方案。

阅读 documentation - 有委托函数。我想你可以这样实现:

我建议你创建 class 作用域变量 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)
}