For a list of methods for this resource, see the end of this page.
Resource representations
Contains properties of a targeting template. A targeting template encapsulates targeting information which can be reused across multiple ads.
{ "kind": "dfareporting#targetingTemplate", "id": long, "accountId": long, "subaccountId": long, "advertiserId": long, "advertiserIdDimensionValue": dimensionValues Resource, "name": string, "geoTargeting": { "excludeCountries": boolean, "countries": [ countries Resource ], "regions": [ regions Resource ], "cities": [ cities Resource ], "metros": [ metros Resource ], "postalCodes": [ postalCodes Resource ] }, "technologyTargeting": { "operatingSystems": [ operatingSystems Resource ], "browsers": [ browsers Resource ], "platformTypes": [ platformTypes Resource ], "mobileCarriers": [ mobileCarriers Resource ], "connectionTypes": [ connectionTypes Resource ], "operatingSystemVersions": [ operatingSystemVersions Resource ] }, "dayPartTargeting": { "userLocalTime": boolean, "daysOfWeek": [ string ], "hoursOfDay": [ integer ] }, "keyValueTargetingExpression": { "expression": string }, "languageTargeting": { "languages": [ languages Resource ] }, "listTargetingExpression": { "expression": string } }
Property name | Value | Description | Notes |
---|---|---|---|
accountId |
long |
Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. | |
advertiserId |
long |
Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert. | |
advertiserIdDimensionValue |
nested object |
Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. | |
dayPartTargeting |
nested object |
Time and day targeting criteria. | |
dayPartTargeting.daysOfWeek[] |
list |
Days of the week when the ad will serve. Acceptable values are:
|
|
dayPartTargeting.hoursOfDay[] |
list |
Hours of the day when the ad will serve, where 0 is midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with days of week, in which case the ad would serve during these hours on the specified days. For example if Monday, Wednesday, Friday are the days of week specified and 9-10am, 3-5pm (hours 9 , 15 , and 16 ) is specified, the ad would serve Monday, Wednesdays, and Fridays at 9-10am and 3-5pm. Acceptable values are 0 to 23 , inclusive. |
|
dayPartTargeting.userLocalTime |
boolean |
Whether or not to use the user's local time. If false, the America/New York time zone applies. | |
geoTargeting |
nested object |
Geographical targeting criteria. | |
geoTargeting.cities[] |
list |
Cities to be targeted. For each city only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a city, do not target or exclude the country of the city, and do not target the metro or region of the city. |
|
geoTargeting.countries[] |
list |
Countries to be targeted or excluded from targeting, depending on the setting of the excludeCountries field. For each country only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting or excluding a country, do not target regions, cities, metros, or postal codes in the same country. |
|
geoTargeting.excludeCountries |
boolean |
Whether or not to exclude the countries in the countries field from targeting. If false, the countries field refers to countries which will be targeted by the ad. |
|
geoTargeting.metros[] |
list |
Metros to be targeted. For each metro only dmaId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a metro, do not target or exclude the country of the metro. |
|
geoTargeting.postalCodes[] |
list |
Postal codes to be targeted. For each postal code only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a postal code, do not target or exclude the country of the postal code. |
|
geoTargeting.regions[] |
list |
Regions to be targeted. For each region only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting a region, do not target or exclude the country of the region. |
|
id |
long |
ID of this targeting template. This is a read-only, auto-generated field. | |
keyValueTargetingExpression |
nested object |
Key-value targeting criteria. | |
keyValueTargetingExpression.expression |
string |
Keyword expression being targeted by the ad. | |
kind |
string |
Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplate" . |
|
languageTargeting |
nested object |
Language targeting criteria. | |
languageTargeting.languages[] |
list |
Languages that this ad targets. For each language only languageId is required. The other fields are populated automatically when the ad is inserted or updated. |
|
listTargetingExpression |
nested object |
Remarketing list targeting criteria. | |
listTargetingExpression.expression |
string |
Expression describing which lists are being targeted by the ad. | |
name |
string |
Name of this targeting template. This field is required. It must be less than 256 characters long and unique within an advertiser. | |
subaccountId |
long |
Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert. | |
technologyTargeting |
nested object |
Technology platform targeting criteria. | |
technologyTargeting.browsers[] |
list |
Browsers that this ad targets. For each browser either set browserVersionId or dartId along with the version numbers. If both are specified, only browserVersionId will be used. The other fields are populated automatically when the ad is inserted or updated. |
|
technologyTargeting.connectionTypes[] |
list |
Connection types that this ad targets. For each connection type only id is required. The other fields are populated automatically when the ad is inserted or updated. |
|
technologyTargeting.mobileCarriers[] |
list |
Mobile carriers that this ad targets. For each mobile carrier only id is required, and the other fields are populated automatically when the ad is inserted or updated. If targeting a mobile carrier, do not set targeting for any zip codes. |
|
technologyTargeting.operatingSystemVersions[] |
list |
Operating system versions that this ad targets. To target all versions, use operatingSystems . For each operating system version, only id is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system version, do not set targeting for the corresponding operating system in operatingSystems . |
|
technologyTargeting.operatingSystems[] |
list |
Operating systems that this ad targets. To target specific versions, use operatingSystemVersions . For each operating system only dartId is required. The other fields are populated automatically when the ad is inserted or updated. If targeting an operating system, do not set targeting for operating system versions for the same operating system. |
|
technologyTargeting.platformTypes[] |
list |
Platform types that this ad targets. For example, desktop, mobile, or tablet. For each platform type, only id is required, and the other fields are populated automatically when the ad is inserted or updated. |
Methods
- get
- Gets one targeting template by ID.
- insert
- Inserts a new targeting template.
- list
- Retrieves a list of targeting templates, optionally filtered. This method supports paging.
- patch
- Updates an existing targeting template. This method supports patch semantics.
- update
- Updates an existing targeting template.