地址素材资源
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
与其他素材资源不同,在您创建素材资源集后,Google Ads API 会自动创建地址素材资源。首先,创建地址同步素材资源集并将其附加到客户。然后,如果您需要为某个广告系列或广告组选择素材资源集中部分地址素材资源,请创建地址组素材资源集,并将其附加到相应广告系列或广告组。
创建地址同步素材资源集并将其附加到客户
- 创建位置同步素材资源组。
- 使用
CustomerAssetSetService
将其附加到客户。
创建营业地点同步素材资源集
- 创建新的
AssetSet
。
- 将
type
设置为 LOCATION_SYNC
。
- 将
location_set
设置为新的 LocationSet
。
- 在新的
LocationSet
中,
- 根据您的使用情形设置
location_ownership_type
:
- 根据您的使用场景设置
source
oneof 字段:
- 如果您想与 Google 商家资料账号中的营业地点同步,请设置为
business_profile_location_set
。
- 如果您想与指定连锁店 ID 中的营业地点同步,请设置
chain_location_set
。
- 如果您想使用地点 ID 手动添加地点,请将此属性设置为
maps_location_set
。
完成这些步骤后,Google Ads API 会生成地址素材资源,并将其添加到为您创建的地址同步素材资源集中,这与您使用 AssetSetAssetService
手动执行此操作类似。除非您想手动将它们添加到静态位置组素材资源集中,否则无需进行任何操作。
对于一个客户,只能存在一个具有(status
的 ENABLED
)的有效位置同步素材资源集。如果您需要创建其他类型的地理位置同步素材资源组,请先移除现有的地理位置同步素材资源组。
将位置同步素材资源组附加到客户
使用 CustomerAssetSetService.MutateCustomerAssetSets
将上一部分中设置的营业地点同步素材资源集附加到客户。
(可选)创建营业地点组素材资源集并将其附加到广告系列或广告组
只有在需要选择一部分地址素材资源时,才需要使用营业地点组素材资源集。这是因为广告系列和广告组会沿用客户级的地址素材资源。
营业地点组素材资源集包含营业地点同步素材资源集中的一部分营业地点素材资源。您可以利用 Google 商家资料的某些功能(例如按标签或连锁店 ID 和连锁店位置进行过滤)动态创建营业地点组素材资源集。或者,您也可以静态创建位置组素材资源集。
- 创建营业地点组素材资源集。营业地点组素材资源集的类型可以是动态或静态。
- 根据需要,将素材资源集附加到广告系列或广告组。
- (可选)将之前生成的素材资源添加到新创建的静态位置组素材资源集中。
对于特定客户,您可以创建多个动态或静态营业地点组素材资源集。
创建营业地点组素材资源集
创建新的 AssetSet
并将 location_group_parent_asset_set_id
设置为之前创建的地址同步素材资源集的 ID。
然后,根据您要创建动态还是静态营业地点组素材资源集,设置一些字段。
动态素材资源组
根据您在 LocationSet
中设置的字段,按照以下规则设置字段:
如果您设置了以下字段 |
然后将类型设置为 |
并将此字段设置为 asset_set_source oneof 字段 |
business_profile_location_set |
BUSINESS_PROFILE_DYNAMIC_LOCATION_GROUP |
business_profile_location_group |
chain_location_set |
CHAIN_DYNAMIC_LOCATION_GROUP |
chain_location_group |
如果您在创建位置同步素材资源集时设置了 maps_location_set
,则无法创建动态位置群组素材资源集。这是因为您已通过地点 ID 手动添加了位置,而您无法使用任何过滤功能来过滤此类位置。
静态素材资源组
将 type
设置为 STATIC_LOCATION_GROUP
。
您可以为任何类型的位置同步素材资源组创建静态位置组素材资源组,无论您在 LocationSet
中设置了哪些字段(business_profile_location_set
、chain_location_set
或 maps_location_set
)。
对于静态营业地点组素材资源集,您需要手动将生成的地址素材资源添加到营业地点组素材资源集。
将素材资源组附加到广告系列或广告组
使用 CampaignAssetSetService.MutateCampaignAssetSets
将地理位置组素材资源集附加到您的广告系列。
或者,如果您想将营业地点组素材资源集附加到广告组,请使用 AdGroupAssetSetService.MutateAdGroupAssetSets
。
(可选)将地址素材资源添加到静态营业地点组素材资源集中
仅当您之前创建了静态营业地点组素材资源集时,才需要执行此步骤。
- 使用
asset_set_asset
报告可提取为之前创建的位置同步素材资源组自动生成的素材资源的资源名称。使用过滤功能可仅检索所需的素材资源。
- 使用
AssetSetAssetService.MutateAssetSetAssets
将它们添加到静态营业地点组素材资源集。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-27。
[null,null,["最后更新时间 (UTC):2025-08-27。"],[[["\u003cp\u003eLocation assets are automatically created after you create and attach a location sync asset set to the customer.\u003c/p\u003e\n"],["\u003cp\u003eCreate a location sync asset set by defining its type and location source (Business Profile, chain, or manual).\u003c/p\u003e\n"],["\u003cp\u003eIf needed, create a location group asset set (dynamic or static) to select a subset of location assets for a campaign or ad group.\u003c/p\u003e\n"],["\u003cp\u003eDynamic location group asset sets leverage Business Profile or chain features for filtering, while static ones require manual asset addition.\u003c/p\u003e\n"],["\u003cp\u003eAttach the location sync asset set to the customer and, optionally, the location group asset set to a campaign or ad group.\u003c/p\u003e\n"]]],[],null,["# Location assets\n\nUnlike other assets, location assets are automatically created by the Google Ads API\nafter you create an asset set. First, create a location sync asset set and\nattach it to the customer. Then, if you need to select a subset of the location\nassets in the asset set for a campaign or ad group, create a location group\nasset set and attach it to the campaign or ad group.\n\nCreate a location sync asset set and attach it to the customer\n--------------------------------------------------------------\n\n1. [Create a **location sync** asset set](#create-location-sync).\n2. [Attach it to a customer using\n `CustomerAssetSetService`](/google-ads/api/reference/rpc/v21/CustomerAssetSetService).\n\n### Create a location sync asset set\n\n1. Create a new [`AssetSet`](/google-ads/api/reference/rpc/v21/AssetSet).\n 1. Set `type` to [`LOCATION_SYNC`](/google-ads/api/reference/rpc/v21/AssetSetTypeEnum.AssetSetType#location_sync).\n 2. Set `location_set` to a new [`LocationSet`](/google-ads/api/reference/rpc/v21/LocationSet).\n2. In the new `LocationSet`,\n 1. Set `location_ownership_type` based on your use case:\n - Set it to [`BUSINESS_OWNER`](/google-ads/api/reference/rpc/v21/LocationOwnershipTypeEnum.LocationOwnershipType#business_owner) if you own the business location.\n - Set it to [`AFFILIATE`](/google-ads/api/reference/rpc/v21/LocationOwnershipTypeEnum.LocationOwnershipType#affiliate) if you don't own the business location, but sell your products there.\n 2. Set the `source` oneof field based on your use case:\n - Set `business_profile_location_set` if you want to sync with your locations in your [Google Business Profile](//www.google.com/business/) account.\n - Set `chain_location_set` if you want to sync with locations in specified chain IDs.\n - Set `maps_location_set` if you want to manually add locations using [Place IDs](/maps/documentation/places/web-service/place-id).\n\nAfter you complete these steps, the Google Ads API generates **location\nassets** and adds them to the created location sync asset set for you, similar\nto when you manually do so using\n[`AssetSetAssetService`](/google-ads/api/reference/rpc/v21/AssetSetAssetService). You don't need to\nmanipulate them unless you want to manually [add them to a static location\ngroup asset sets](#add-location-assets).\n\nOnly one active location sync asset set with\n([`status`](/google-ads/api/reference/rpc/v21/AssetSet#status) of\n[`ENABLED`](/google-ads/api/reference/rpc/v21/AssetSetStatusEnum.AssetSetStatus#enabled)) can exist\nfor a customer. If you need to create a different type of location sync asset\nset, remove the existing one first.\n\n### Attach the location sync asset set to a customer\n\nUse\n[`CustomerAssetSetService.MutateCustomerAssetSets`](/google-ads/api/reference/rpc/v21/CustomerAssetSetService/MutateCustomerAssetSets)\nto attach the location sync asset set in the previous section to your customer.\n\n(Optional) Create a location group asset set and attach it to a campaign or an ad group\n---------------------------------------------------------------------------------------\n\nA **location group** asset set is necessary only if you need to select a subset\nof location assets. This is due to campaigns and ad groups inheriting location\nassets from the customer level.\n\nLocation group asset sets contain a subset of location assets of the **location\nsync** asset set. You can dynamically create a location group asset set by\nleveraging some features of Google Business Profile (like filtering by labels)\nor chain IDs and chain locations. Alternatively, you can statically create a\nlocation group asset set.\n\n1. [Create a location group asset set](#create-location-group). The location group asset set can be **dynamic** or **static**.\n2. [Attach the asset set to a campaign using or to an ad group, depending on\n your need](#attach-location-group).\n3. [(Optional) Add the previously generated assets to the newly created static\n location group asset set](#add-location-assets).\n\nFor a given customer, you can create multiple dynamic or static location group\nasset sets.\n\n### Create a location group asset set\n\nCreate a new [`AssetSet`](/google-ads/api/reference/rpc/v21/AssetSet) and set\n`location_group_parent_asset_set_id` to the ID of the previously created\nlocation sync asset set.\n\nThen, set some fields based on whether you want to create a dynamic or static\nlocation group asset set.\n\n#### Dynamic asset sets\n\nDepending on the field you [set in `LocationSet`](#create-location-sync), set\nthe fields based on the following rule:\n\n| If you set the following field | Then set [type](/google-ads/api/reference/rpc/v21/AssetSet#type) to | And set this field as the [asset_set_source](/google-ads/api/reference/rpc/v21/AssetSet#asset_set_source) oneof field |\n|---------------------------------|---------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|\n| `business_profile_location_set` | `BUSINESS_PROFILE_DYNAMIC_LOCATION_GROUP` | `business_profile_location_group` |\n| `chain_location_set` | `CHAIN_DYNAMIC_LOCATION_GROUP` | `chain_location_group` |\n\nIf you set `maps_location_set` when [creating the location sync asset\nset](#create-location-sync), you won't be able to create a dynamic location\ngroup asset set. This is because you've manually added locations by Place IDs\nand there are no filtering features you can use for this type of locations.\n\n#### Static asset sets\n\nSet [`type`](/google-ads/api/reference/rpc/v21/AssetSet#type) to\n[`STATIC_LOCATION_GROUP`](/google-ads/api/reference/rpc/v21/AssetSetTypeEnum.AssetSetType#static_location_group).\nYou can create static location group asset sets for any types of location\nsync asset sets, no matter what fields (`business_profile_location_set`,\n`chain_location_set`, or `maps_location_set`) you set in the\n[`LocationSet`](/google-ads/api/reference/rpc/v21/LocationSet#source).\n\nFor **static** location group asset sets, you need to\n[manually add the generated location assets to the location group asset\nsets](#add-location-assets).\n\n### Attach the asset set to a campaign or to an ad group\n\nUse\n[`CampaignAssetSetService.MutateCampaignAssetSets`](/google-ads/api/reference/rpc/v21/CampaignAssetSetService/MutateCampaignAssetSets)\nto attach the [location group asset set](#create-location-group) to your\ncampaign.\n\nAlternatively, use\n[`AdGroupAssetSetService.MutateAdGroupAssetSets`](/google-ads/api/reference/rpc/v21/AdGroupAssetSetService/MutateAdGroupAssetSets)\nif you want to attach the [location group asset set](#create-location-group) to\nan ad group instead.\n\n### (Optional) Add the location assets to the **static** location group asset set\n\nThis step is required only if you create a\n[static location group asset set](#static-asset-sets) previously.\n\n1. Use the [`asset_set_asset`](/google-ads/api/fields/v21/asset_set_asset) report to fetch the resource names of assets automatically generated for the [previously created location sync asset set](#create-location-sync). Use [filtering](/google-ads/api/docs/query/structure#where) to retrieve only the assets you want.\n2. Add them to the [static location group asset set](#static-asset-sets) using [`AssetSetAssetService.MutateAssetSetAssets`](/google-ads/api/reference/rpc/v21/AssetSetAssetService/MutateAssetSetAssets)."]]