Placement
url
adsenseformobileapps.com
INVALID_PLACEMENT_URL
UserList.isEligibleForSearch = false
isEligibleForSearch
get
query
IsEligibleForSearch
IsEligibleForDisplay
criterion
UserList
CriterionError.CANNOT_ADD_CRITERION_TO_SEARCH_PLUS_CAMPAIGNS
targetAll=false
A lot of our DFP API developers have been asking recently about how to filter report data by custom targeting key ID. Currently the DFP API allows you to filter report data by custom targeting value ID only. Until we have official support for filtering by custom targeting key ID in reports, you can use the CustomTargetingService and the ReportService together to achieve this goal.
WHERE customTargetingKeyId IN (17, 18, 19)
If you have a lot of keys and values in your network, a better approach is to store these in a local database and do nightly syncs. Use getCustomTargetingKeysByStatement to obtain all the keys in your network, and then iterate through them, calling getCustomTargetingValuesByStatement for each key to obtain their values. Our client libraries all have examples of this. For instance, the Java example can be found in our ads Java client library GitHub repository. This way, you can look up the values associated with a custom targeting key more quickly and not do an additional API call.
IN
WHERE CUSTOM_TARGETING_VALUE_ID IN (3211, 88990, 123456)
However, please be aware that if you have a lot of custom targeting value IDs to filter on, you should batch them by querying for no more than 500 IDs at a time in the PQL IN clause. For example, you will run your report filtering on the first 500 IDs you’ve collected and save that report. Then you will run the same report on the next page of 500 IDs you’ve collected and so on until you have no more IDs. You can then combine the reports locally so that you have all the data for those custom targeting IDs.
If you have any questions about this, feel free to drop us a line on the DFP API forums or Ads Developer Google+ page.
- Vincent Tsao, DFP API Team
optIn
Imagine for a moment that you're a mobile line item. You've just been initialized locally, and all of a sudden you’re having an existential crisis -- what makes you, you? How are you different from all the other line items? Sure your associated creative might be a bit different from other line items and you might have a few extra impressions allotted to your goal, but what truly makes you... unique? In this series of posts, we'll take you on an incredible journey through a day in the life of a mobile line item -- from how to target mobile to the actual delivery on a device.
It all starts similarly enough: you need a name, an order ID, start and end dates, a goal, and all the usual suspects -- but wait, there's more! Instead of just having custom criteria, ad units, and geo-targeting, you find that you also have TechnologyTargeting fields specified, like:
Now, say you're being created as a line item to advertise Android tablet cases. It doesn't make much sense for you to be delivered to an iPad or an iPhone, so we need to add technology specific targeting.
To do so using Java, we would first set the DeviceCategory object with the targeting ID of the 'Tablet' category and the OperatingSystem object with the targeting ID of 'Android', both of which we'd pull from the PublisherQueryLanguage service:
DeviceCategory deviceCategory = new DeviceCategory(); OperatingSystem operatingSystem = new OperatingSystem(); deviceCategory.setId(30002L); operatingSystem.setId(501013L);
These would then be set on the DeviceCategoryTargeting and OperatingSystemTargeting objects:
DeviceCategoryTargeting deviceCategoryTargeting = new DeviceCategoryTargeting(); OperatingSystemTargeting operatingSystemTargeting = new OperatingSystemTargeting(); deviceCategoryTargeting.setTargetedDeviceCategories(new DeviceCategory[] {deviceCategory}); operatingSystemTargeting.setOperatingSystems(new OperatingSystem[] {operatingSystem});
Finally, the Targeting object will have a TechnologyTargeting object set for DeviceCategoryTargeting and also OperatingSystemTargeting:
TechnologyTargeting techTargeting = new TechnologyTargeting(); technologyTargeting.setDeviceCategoryTargeting(deviceCategoryTargeting); technologyTargeting.setOperatingSystemTargeting(operatingSystemTargeting); Targeting targeting = new Targeting(); targeting.setTechnologyTargeting(techTargeting);
Now what happens? You're a line item that has a bit of technology targeting specified, but where are you off to next? Stay tuned for what happens next in - 'A day in the life of a mobile line item, part 2.'
- Nicholas Chen, DFP API Team
30001
0
-100%
<criterion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Platform"> <id>30001</id> <type>PLATFORM</type> <Criterion.Type>Platform</Criterion.Type> <platformName>HighEndMobile</platformName> </criterion> <!-- This will appear as "-100%" in the UI. --> <bidModifier>0.0</bidModifier>
1.25
<criterion xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201402" xsi:type="ns2:Platform"> <ns2:id>30001</ns2:id> </criterion> <!-- This will appear as "+125%" in the UI. Any other non-zero value will also fail. --> <bidModifier>1.25</bidModifier>
LocationGroups
PlacesOfInterestOperand
GeoTargetOperand
LocationGroups locationGroup = new LocationGroups(); Function matchingFunction = new Function(); matchingFunction.setLhsOperand(new FunctionArgumentOperand[] { new PlacesOfInterestOperand(null, PlacesOfInterestOperandCategory.AIRPORT) }); matchingFunction.setOperator(FunctionOperator.AND); matchingFunction.setRhsOperand(new FunctionArgumentOperand[] { new GeoTargetOperand(null, new long[]{ 1023191L }) // ID for NYC }); locationGroup.setMatchingFunction(matchingFunction);
ParentIds
PAUSED