---
title: "GET /userprofiles/{userprofilesId}/targetingTemplates"
method: GET
path: "/userprofiles/{userprofilesId}/targetingTemplates"
tags: ["targetingTemplates"]
---

# GET /userprofiles/{userprofilesId}/targetingTemplates

`GET /userprofiles/{userprofilesId}/targetingTemplates`

## Request

- Base URL: `https://dfareporting.googleapis.com/dfareporting/v5`
- URL: `https://dfareporting.googleapis.com/dfareporting/v5/userprofiles/{userprofilesId}/targetingTemplates`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/dfatrafficking`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/dfatrafficking`
- TypeScript: <https://skmtc.dev/google/apis/dfareporting/docs/userprofiles/:userprofilesId/targetingTemplates/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves a list of targeting templates, optionally filtered. This method supports paging.

## Path parameters

- `userprofilesId` string, required

## Query parameters

- `advertiserId` string, int64
- `ids` string[]
- `maxResults` integer
- `pageToken` string
- `searchString` string
- `sortField` 'ID' | 'NAME'
- `sortOrder` 'ASCENDING' | 'DESCENDING'

## Response `200`

Successful response

- TargetingTemplatesListResponse: Targeting Template List Response
  - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#targetingTemplatesListResponse".
  - `nextPageToken` string: Pagination token to be used for the next list operation.
  - `targetingTemplates` TargetingTemplate[]: Targeting template collection.
    - `accountId` string, int64: Account ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.
    - `advertiserId` string, int64: Advertiser ID of this targeting template. This is a required field on insert and is read-only after insert.
    - `advertiserIdDimensionValue` DimensionValue: Represents a DimensionValue resource.
      - `dimensionName` string: The name of the dimension.
      - `etag` string: The eTag of this response for caching purposes.
      - `id` string: The ID associated with the value if available.
      - `kind` string: The kind of resource this is, in this case dfareporting#dimensionValue.
      - `matchType` 'EXACT' | 'BEGINS_WITH' | 'CONTAINS' | 'WILDCARD_EXPRESSION': Determines how the 'value' field is matched when filtering. If not specified, defaults to EXACT. If set to WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable length character sequences, and it can be escaped with a backslash. Note, only paid search dimensions ('dfa:paidSearch*') allow a matchType other than EXACT.
      - `value` string: The value of the dimension.
    - `contextualKeywordTargeting` ContextualKeywordTargeting: Contextual Keyword Targeting.
      - `keywords` ContextualKeyword[]: Contextual keywords that this ad targets
        - `keyword` string: The keyword that can be targeted by ads.
    - `dayPartTargeting` DayPartTargeting: Day Part Targeting.
      - `daysOfWeek` string[]: Days of the week when the ad will serve. Acceptable values are: - "SUNDAY" - "MONDAY" - "TUESDAY" - "WEDNESDAY" - "THURSDAY" - "FRIDAY" - "SATURDAY"
      - `hoursOfDay` integer[]: 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.
      - `userLocalTime` boolean: Whether or not to use the user's local time. If false, the America/New York time zone applies.
    - `geoTargeting` GeoTargeting: Geographical Targeting.
      - `cities` City[]: 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.
        - `countryCode` string: Country code of the country to which this city belongs.
        - `countryDartId` string, int64: DART ID of the country to which this city belongs.
        - `dartId` string, int64: DART ID of this city. This is the ID used for targeting and generating reports.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#city".
        - `metroCode` string: Metro region code of the metro region (DMA) to which this city belongs.
        - `metroDmaId` string, int64: ID of the metro region (DMA) to which this city belongs.
        - `name` string: Name of this city.
        - `regionCode` string: Region code of the region to which this city belongs.
        - `regionDartId` string, int64: DART ID of the region to which this city belongs.
      - `countries` Country[]: 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.
        - `countryCode` string: Country code.
        - `dartId` string, int64: DART ID of this country. This is the ID used for targeting and generating reports.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#country".
        - `name` string: Name of this country.
        - `sslEnabled` boolean: Whether ad serving supports secure servers in this country.
        - `tvDataProviders` string[]: Output only. The TV data providers supported in this country.
      - `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.
      - `metros` Metro[]: 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.
        - `countryCode` string: Country code of the country to which this metro region belongs.
        - `countryDartId` string, int64: DART ID of the country to which this metro region belongs.
        - `dartId` string, int64: DART ID of this metro region.
        - `dmaId` string, int64: DMA ID of this metro region. This is the ID used for targeting and generating reports, and is equivalent to metro_code.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#metro".
        - `metroCode` string: Metro code of this metro region. This is equivalent to dma_id.
        - `name` string: Name of this metro region.
      - `postalCodes` PostalCode[]: 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.
        - `code` string: Postal code. This is equivalent to the id field.
        - `countryCode` string: Country code of the country to which this postal code belongs.
        - `countryDartId` string, int64: DART ID of the country to which this postal code belongs.
        - `id` string: ID of this postal code.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#postalCode".
      - `regions` Region[]: 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.
        - `countryCode` string: Country code of the country to which this region belongs.
        - `countryDartId` string, int64: DART ID of the country to which this region belongs.
        - `dartId` string, int64: DART ID of this region.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#region".
        - `name` string: Name of this region.
        - `regionCode` string: Region code.
    - `id` string, int64: ID of this targeting template. This is a read-only, auto-generated field.
    - `keyValueTargetingExpression` KeyValueTargetingExpression: Key Value Targeting Expression.
      - `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` LanguageTargeting: Language Targeting.
      - `languages` Language[]: 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.
        - `id` string, int64: Language ID of this language. This is the ID used for targeting and generating reports.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#language".
        - `languageCode` string: Format of language code is an ISO 639 two-letter language code optionally followed by an underscore followed by an ISO 3166 code. Examples are "en" for English or "zh_CN" for Simplified Chinese.
        - `name` string: Name of this language.
    - `listTargetingExpression` ListTargetingExpression: Remarketing List Targeting Expression.
      - `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` string, int64: Subaccount ID of this targeting template. This field, if left unset, will be auto-generated on insert and is read-only after insert.
    - `technologyTargeting` TechnologyTargeting: Technology Targeting.
      - `browsers` Browser[]: 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.
        - `browserVersionId` string, int64: ID referring to this grouping of browser and version numbers. This is the ID used for targeting.
        - `dartId` string, int64: DART ID of this browser. This is the ID used when generating reports.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#browser".
        - `majorVersion` string: Major version number (leftmost number) of this browser. For example, for Chrome 5.0.376.86 beta, this field should be set to 5. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is.
        - `minorVersion` string: Minor version number (number after first dot on left) of this browser. For example, for Chrome 5.0.375.86 beta, this field should be set to 0. An asterisk (*) may be used to target any version number, and a question mark (?) may be used to target cases where the version number cannot be identified. For example, Chrome *.* targets any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad server knows the browser is Firefox but can't tell which version it is.
        - `name` string: Name of this browser.
      - `connectionTypes` ConnectionType[]: 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.
        - `id` string, int64: ID of this connection type.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#connectionType".
        - `name` string: Name of this connection type.
      - `mobileCarriers` MobileCarrier[]: 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.
        - `countryCode` string: Country code of the country to which this mobile carrier belongs.
        - `countryDartId` string, int64: DART ID of the country to which this mobile carrier belongs.
        - `id` string, int64: ID of this mobile carrier.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#mobileCarrier".
        - `name` string: Name of this mobile carrier.
      - `operatingSystemVersions` OperatingSystemVersion[]: 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.
        - `id` string, int64: ID of this operating system version.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystemVersion".
        - `majorVersion` string: Major version (leftmost number) of this operating system version.
        - `minorVersion` string: Minor version (number after the first dot) of this operating system version.
        - `name` string: Name of this operating system version.
        - `operatingSystem` OperatingSystem: Contains information about an operating system that can be targeted by ads.
          - `dartId` string, int64: DART ID of this operating system. This is the ID used for targeting.
          - `desktop` boolean: Whether this operating system is for desktop.
          - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystem".
          - `mobile` boolean: Whether this operating system is for mobile.
          - `name` string: Name of this operating system.
      - `operatingSystems` OperatingSystem[]: 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.
        - `dartId` string, int64: DART ID of this operating system. This is the ID used for targeting.
        - `desktop` boolean: Whether this operating system is for desktop.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#operatingSystem".
        - `mobile` boolean: Whether this operating system is for mobile.
        - `name` string: Name of this operating system.
      - `platformTypes` PlatformType[]: 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.
        - `id` string, int64: ID of this platform type.
        - `kind` string: Identifies what kind of resource this is. Value: the fixed string "dfareporting#platformType".
        - `name` string: Name of this platform type.

---

[API](https://skmtc.dev/google/apis/dfareporting.md) - [All operations](https://skmtc.dev/google/apis/dfareporting/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/dfareporting/revisions/be73a9a450de?raw)
