Skip to content

Google DFP - Swift

The Pulse platform can also serve real-time ads with dynamic creative optimization using Google DFP.

This capability only works when an app is in foreground mode (i.e. when the app is open).

Follow the instructions to integrate DFP:

  1. Setup Google DFP SDK as Google's instructions. Refer to Google DFP Quickstart.

  2. Enable DFP feature on this app using the Pulse Platform.

  3. Set up a campaign and copy its tag into your Google DFP ad serving setup

  4. Finally, add the getDFPTags method to Google AdMob’s customTargeting method. For example :

//declare the ad banner and assign it the unit ID
bannerView.adUnitID = "/<yourDFPAccount>/<Your_DCO_Banner>"
bannerView.rootViewController = self
//make the view controller class the GADBannerViewDelegate
bannerView.delegate = self
var request:DFPRequest = DFPRequest()
// Notify DFP using custom parameters to load Pulse Creative
request.customTargeting = PulseSDK.sharedClient().getDFPTags() as! [String: String]