DFP Conversion and Audience Tracking

The instructions on this page is specific to integrating the Conversion Tracking SDK with DoubleClick for Publishers (DFP).

The Conversion Tracking SDK allows you to measure the impact of app promotion campaigns.

  • As an advertiser, you can tag the events you'd like to track in your app, and then work with a DFP publisher to see how many of these conversions are being driven by direct sale campaigns.
  • As a publisher, you can tag any event in your app to be tracked as a conversion. When users perform the tagged action after interacting with an ad, the event will be recorded and viewable in DFP Conversion Reporting.

By using the SDK to tag user activity in your app (e.g., purchases or progress in a game), publishers can then use DFP Audience to reach certain users with ads. This will allow you to focus on users who have completed those specific actions by displaying re-engagement ads in the future.

The following sections describe how to incorporate the SDK in either Android or iOS, and then how to track in-app conversions and audience segments. There's also a tip on how to confirm that your setup is actually reporting conversions.

Incorporate the SDK in Android

  1. Download the SDK. The decompressed SDK consists of a JAR file.

  2. Right click on your app project in Eclipse and choose Properties.

  3. Select Java Build Path and the Libraries tab. Then click Add External JARs... to add the GoogleConversionTrackingSdk.jar file.

  4. Open your AndroidManifest.xml file for editing.

  5. Make sure your app uses these 2 permissions:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  6. Publish a receiver to listen for the INSTALL_REFERRER intent, which contains information about new app installs:

    <receiver android:name="com.google.ads.conversiontracking.InstallReceiver"
        <action android:name="com.android.vending.INSTALL_REFERRER" />

Incorporate the SDK in iOS

For the following instructions, a sample project named ConversionExample is used. When going through the steps, replace ConversionExample with your project's name.

  1. Download and unpack the SDK.

  2. Right click on your project folder in Xcode and select Add Files to "ConversionExample"...

  3. Select the unpacked SDK folder and click Add.

  4. The SDK library references the iOS AdSupport development framework, which may not yet be part of your project. To add this framework, open the Link Binary With Libraries dropdown under the Build Phases tab. Use the + button to add the framework from the iOS SDK.

  5. Add -ObjC to the Other Linker Flags of your application target's build setting:

    1. In Xcode's project navigator, press the blue top-level project icon.
    2. Click on your target, and then the Build Settings tab.
    3. Under Linking > Other Linker Flags, add -ObjC to both Debug and Release.

Track in-app conversions

The Application downloads (counter) activity types (one for iOS, one for Android) track conversions for the initial launch of a mobile application. In their apps, advertisers include a small snippet of code that pings DFP upon the app's first launch. If a user has recently viewed and/or clicked one of that advertiser's ads in a DFP publisher's app, DFP will count that as an app download conversion.

You'll need to create separate activity groups and snippets to track iOS and Android conversions.

Important: This feature only works with in-app ads. Conversions are not counted if the ad is initially viewed on the web (desktop or mobile) and the application is subsequently downloaded. Here are examples of conversion snippets:

  • iOS (to be included in your application delegate's application:didFinishLaunchingWithOptions: method);

    [DCTConversionReporter reportWithConversionID:@"<activity id>"
                           value:nil /* or price of app if desired */
  • Android (to be included in your application's main activity):

        this.getApplicationContext(), "<activity id>",
        null, null /* or price of app if desired */, false);

Track in-app audience segments

Users can be added to DFP audience lists within an application in one of two ways: based on ad requests, or based on activities.

Audience membership changes based on ad requests are triggered at the time of the ad request, assuming that the DFP segment is configured with a matching targeting rule. You don't need to take any action within your application to enable this behavior.

When you want to add a user to an audience segment on a screen where you're not showing ads (e.g., a shopping cart), you can report on an activity that can be used as a signal for populating the audience segment. This is the in-app equivalent to the web-based audience pixel tags. To properly trigger the segment membership through the activity, you will need to configure the activity with ad unit and custom targeting key/value pairs matching the targeting rule of the DFP segment.

Here are examples of conversion snippets:

  • iOS (to be included in your application delegate's application:didFinishLaunchingWithOptions: method);

    [DCTActivityReporter reportWithAdUnitID:@"DFPAudiencePixel"
                           customParameters:nil  /* or key value pairs if desired */];
  • Android (to be included in your application's main activity):

        this.getApplicationContext(), "DFPAudiencePixel",
        /* key value pairs, if desired */);

Confirm your setup

When you go into your app and carry out the conversion event that you've defined, you should see messages similar to the following logged at the Info level:

I/GoogleConversionReporter( 1557): Pinging: [...]

I/GoogleConversionReporter( 1557): Ping responded with response code 200

The HTTP 200 response code indicates that the conversion was successfully reported to Google AdWords.

Enviar comentarios sobre…

Mobile Apps Conversion Tracking and Remarketing
Mobile Apps Conversion Tracking and Remarketing