google_ads_campaign_asset
A campaign asset links an asset to one campaign, telling Google the asset is eligible to show with that campaign’s ads. This is how a sitelink, callout, or structured snippet actually reaches the page — the asset holds the content, the campaign asset attaches it.
field_type says what kind of extension the asset is used as
(SITELINK, CALLOUT, STRUCTURED_SNIPPET, …). Leave it out — the
pairing is 1:1, so bidsmith reads it off the asset you pointed at. Write
one that contradicts the asset and validate says so, instead of the
API rejecting the whole batch later.
Attaching a whole set
assets takes a list and fans out to one attachment per entry, so a set
of sitelinks is one block rather than one block each:
resource "google_ads_campaign_asset" "gh_cookies_sitelinks" { campaign = google_ads_campaign.gh_cookies.id assets = [ google_ads_sitelink_asset.add_to_chrome.id, google_ads_sitelink_asset.how_it_works.id, google_ads_sitelink_asset.pricing.id, ]}Every attachment in the list gets the same campaign and status, and
each one’s field_type comes from its own asset — so a list may mix
sitelinks and callouts.
Example
Attach a sitelink to a Search campaign:
resource "google_ads_sitelink_asset" "add_to_chrome" { link_text = "Add to Chrome" description1 = "Free, open source" description2 = "Install in 10 seconds" final_urls = ["https://www.ghostery.com/ghostery-ad-blocker"]}
resource "google_ads_campaign_asset" "gh_cookies_sitelink" { campaign = google_ads_campaign.gh_cookies.id asset = google_ads_sitelink_asset.add_to_chrome.id field_type = "SITELINK" status = "ENABLED"}Schema
Required
-
campaign( reference_or_resource_name )
Optional
-
asset( Reference togoogle_ads_call_assetorgoogle_ads_sitelink_assetorgoogle_ads_callout_assetorgoogle_ads_structured_snippet_asset) -
assets( List of Reference ) -
field_type( String ) One of:HEADLINE,DESCRIPTION,MANDATORY_AD_TEXT,MARKETING_IMAGE,MEDIA_BUNDLE,YOUTUBE_VIDEO,BOOK_ON_GOOGLE,LEAD_FORM,PROMOTION,CALLOUT,STRUCTURED_SNIPPET,SITELINK,MOBILE_APP,HOTEL_CALLOUT,CALL,PRICE,LONG_HEADLINE,BUSINESS_NAME,SQUARE_MARKETING_IMAGE,PORTRAIT_MARKETING_IMAGE,LOGO,LANDSCAPE_LOGO,VIDEO,CALL_TO_ACTION_SELECTOR,AD_IMAGE,BUSINESS_LOGO,HOTEL_PROPERTY,DISCOVERY_CAROUSEL_CARD. -
status( String ) One of:ENABLED,PAUSED,REMOVED. Default"ENABLED"; omit to manage at the default.
See also
google_ads_sitelink_asset,google_ads_callout_asset,google_ads_structured_snippet_asset— the assets you attach.google_ads_ad_group_asset— attach at ad-group scope.google_ads_customer_asset— attach at account scope.