google adwords conversion tracking with swift

限于喜欢 提交于 2020-01-12 14:28:10

问题


I am trying to get google adwords working on a swift project I have followed https://developers.google.com/app-conversion-tracking/ios/ and have had no results. Keeps saying no such module "ACTReporter"

Does anyone have any info?


回答1:


This is possible in Swift using the usual bridging header routine. You can add the SDK to your project manually or use the GoogleConversionTracking pod.

Just add the pod to your podfile:

pod 'GoogleConversionTracking'

and then add the following to your bridging header:

#import <GoogleConversionTracking/ACTReporter.h>

And finally, in your AppDelegate.swift file (with the correct ID and label):

// Google Conversion Tracking
ACTAutomatedUsageTracker.enableAutomatedUsageReportingWithConversionID("0123456789")
ACTConversionReporter.reportWithConversionID("0123456789", label: "XXXXXX", value: "0.00", isRepeatable: false)


来源:https://stackoverflow.com/questions/33741813/google-adwords-conversion-tracking-with-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!