问题
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