Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

google adwords conversion tracking with swift

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?

like image 662
plaidpancakes Avatar asked Nov 16 '15 18:11

plaidpancakes


1 Answers

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)
like image 124
mm8154 Avatar answered Oct 13 '22 00:10

mm8154