DoubleClick for Publishers (DFP) Small Business is a hosted ad serving solution by Google that helps you manage your online advertising business. DFP supports custom targeting - target ads based on a user's custom properties.
Gigya provides functionality for integrating DFP's ad targeting with user's identity information. This way you may target your ads based on your user's dynamic information, such as age, gender, relationship status, country, likes, etc. For example, you can set an ad to appear only for single men above the age of 30. This document provides a guide on how to integrate Gigya with DFP's ad targeting.
The solution has two parts:
- DFP setup - define custom targeting criteria and specify targeting criteria to specific ads .
- Add Gigya to web-pages that use DFP (see how-to below ).
The ad targeting solution is based on the assumption that we have information about the user, gathered after the user log in / registers to the site through Gigya.
As long as the user is not logged-in there is no ad targeting and the user will be presented with general not targeted ads. When the user logs-in through Gigya, we create a cookie for ad targeting, but the ad is not refreshed immediately. Only after refreshing the page the ad is refreshed and the user data is used in DFP's algorithm for selecting a new ad. Please note, that DFP's algorithm is likely to deliver a targeted ad, but may also deliver a general not targeted ad. Please also note that the ad targeting cookie expires after a day.
Please create a test site in the Gigya admin console for integration testing (don't use your production site) and use a test list on the target integration platform. We are able to put integrations in "sample mode" for testing, which will restrict audiences to 10 sample accounts.
User Data for Ad Targeting
The user data that may be used for ad targeting is the info available in the User object.
If Gigya's Registration-as-a-Service (RaaS) package or Profile Management - IDS (IS) package is part of your site package, then the user data is the info returned by the accounts.getAccountInfo method. This includes identity data and site specific custom data.
To find out whether RaaS/IS package is part of your site package, or to activate RaaS/IS package, please contact your Gigya Account Manager or contact us by filling in a support form on our site.
Adding Gigya to a Web Page that Uses DFP
In this section we use an example to demonstrate integrating Gigya with DFP.
We take a simple web page that uses DFP to present an ad, and add Gigya code to it, thus targeting the ad dynamically based on the user's identity data.
A Simple Page that Uses DFP (Without Gigya)
Adding the Gigya Code
Include Gigya's JS libs: In addition to Gigya's standard gigya.js, you also need to include gigyatargetad.min.js, as shown in the example code:
Wrap DFP's "googletag.defineSlot" method call with Gigya's "gigya.adTarget.attachGoogleTag" method call: Instead of a direct call to DFP's googletag.defineSlot method, we call Gigya's gigya.adTarget.attachGoogleTag method which wraps the DFP method and adds the targeting:
gigya.adTarget.attachGoogleTag method parameters
|targetingMap||JSON Object||The object maps between a DFP ad targeting custom criteria and a Gigya user data field. |
By default the Gigya user data fields are fields of the User Object, e.g. user.country, user.age, etc.
If you set the methodName parameter to " accounts.getAccountInfo " (see below), then the user data fields are the fields returned by the accounts.getAccountInfo method, e.g. profile.age, profile.gender, etc.
|slot||method reference||Reference to DFP's googletag.defineSlot method call.|
|methodName||string||The name of the Gigya method for retrieving user information. The possible values are:|
Preliminary Step - Social Login Integration
To have information about the user, the user has to login to the site through Gigya.
- Whether you implement Social Login. Registration-as-a-Service (RaaS) or Profile Management - IDS (IS), the integration is the same. The only difference is the "methodName" parameter (see description above). If you are using the RaaS/IS package, set the "methodName" parameter to "accounts.getAccountInfo".
In the code example we added Gigya's Login Plugin as a native Social Login implementation