How to create Asset Business Name, Business Name, Image via API?

192 views
Skip to first unread message

san...@knorex.com

unread,
Aug 27, 2024, 7:39:29 AM8/27/24
to Google Ads API and AdWords API Forum
Hi,

I have a Search campaign, I want to setup Business Name, Business Name, Image at the campaign level.
Where is the document to get those info from a campaign? There is no such fields in object "asset". https://developers.google.com/google-ads/api/fields/v17/asset_query_builder

How to create those info in a campaign?

Thanks.
Martin

Google Ads API Forum Advisor

unread,
Aug 27, 2024, 12:34:44 PM8/27/24
to san...@knorex.com, adwor...@googlegroups.com
Hi Martin,

Thank you for reaching out to the Google Ads API support team.

In order to assist you further, could you please provide the uncropped UI screenshot by highlighting the fields that you want to retrieve at a campaign level via the Google Ads API?

Also, I would recommend you refer to this documentation to know more about the Fields/Segments/Metrics that can be used with the campaign resource.

You can send the details via Reply privately to the author option, or direct private reply to this email.


This message is in relation to case "ref:!00D1U01174p.!5004Q02vFR40:ref" (ADR-00265079)

Thanks,
 
Google Logo Google Ads API Team


Message has been deleted

san...@knorex.com

unread,
Aug 28, 2024, 3:25:37 AM8/28/24
to Google Ads API and AdWords API Forum

Hi, 

 

I can get the Business name, Business logo, Image assets from that existing campaign. Those assets are created on GG Ads manager console, not by APIs.

I cannot attach my campaign screenshot, but the UI looks like below:



test_bname.png

 


I am using GG Ads SDK v17, there is no class BussinessNameAsset and BusinessLogoAsset at all.

Thus, I cannot create new Business name and Business logo assets in new campaign via API.

 

I am referring this documentation: https://developers.google.com/google-ads/api/reference/rpc/v17/ActivityCityInfo


Please help me how to create such Assets in the new campaign.

Thanks!

Google Ads API Forum Advisor

unread,
Aug 28, 2024, 4:09:19 AM8/28/24
to san...@knorex.com, adwor...@googlegroups.com
Hi,

Please be informed that the API currently doesn't support business logos and business names. However, these features are under development and will be included in a future release. Stay updated by checking our Developer Blog and Release Notes, where we'll announce the addition of these assets to the API. 

san...@knorex.com

unread,
Aug 28, 2024, 7:44:34 AM8/28/24
to Google Ads API and AdWords API Forum
Hi, 
Thanks for that.

1) How about Image Asset? Can we create it via API and link to the new campaign?
2) Some ad account can create that Image asset in GG Ads manager, some not. What is the condition for an ad account to add that asset to the campaign?



img_asset.png

Google Ads API Forum Advisor

unread,
Aug 28, 2024, 11:49:33 AM8/28/24
to san...@knorex.com, adwor...@googlegroups.com
Hi Martin,

Please find the answers to your questions below:


1) How about Image Asset? Can we create it via API and link to the new campaign?
  • Yes, you can create an image asset and link it to a campaign. I would recommend you refer to this guide on "Asset creation and usage" for information on how to create an asset and use it in an ad. Note that there are certain limitations regarding different ad and campaign types that support different asset types. This information can be found in the same guide provided above.
2) Some ad account can create that Image asset in GG Ads manager, some not. What is the condition for an ad account to add that asset to the campaign?
  • There are certain requirements to meet in order to use image assets. I would recommend you refer to this Help Center article about image assets for more information. Note that the concerns related to creating the image assets in Google Ads account are out of scope for the Google Ads API support team, as our team specializes in Google Ads API related concerns and technical implementations only. With this, I would suggest you reach out to the Google Ads Product support team, as they are better equipped to assist you on this.
I hope this clarifies.

san...@knorex.com

unread,
Aug 28, 2024, 11:57:49 PM8/28/24
to Google Ads API and AdWords API Forum
Hi,
I follow your instructions to link Image to campaign, but it is giving errors.
I am using this enum: com.google.ads.googleads.v15.enums.AssetFieldTypeEnum.AssetFieldType.AD_IMAGE


Please check below request and response:
Request
-------
MethodName: google.ads.googleads.v15.services.CampaignAssetService/MutateCampaignAssets
Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=REDACTED, x-goog-api-client=gl-java/1.8.0_202 gccl/28.0.0 gapic/28.0.0 gax/2.32.0 grpc/1.56.1}
Body: customer_id: "REDACTED"
operations {
  create {
    field_type: AD_IMAGE
    campaign: "customers/REDACTED/campaigns/20671574339"
    asset: "customers/REDACTED/assets/93874744246"
  }
}


Response
--------
Headers: Metadata(content-type=application/grpc,request-id=g8QxWGVg5taGPCYOy1JB3w,date=Thu, 29 Aug 2024 03:53:05 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000)
Body: null
Failure message: errors {
  error_code {
    asset_link_error: FIELD_TYPE_INCOMPATIBLE_WITH_CAMPAIGN_TYPE
  }
  message: "The specified field type is incompatible with the given campaign type."
  trigger {
    string_value: "AD_IMAGE,UBERVERSAL"
  }
  location {
    field_path_elements {
      field_name: "operations"
      index: 0
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "field_type"
    }
  }
}
request_id: "g8QxWGVg5taGPCYOy1JB3w"

Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.

Google Ads API Forum Advisor

unread,
Aug 29, 2024, 3:56:33 AM8/29/24
to san...@knorex.com, adwor...@googlegroups.com
Hi,

Based on the provided information, I understand that you have encountered an 'FIELD_TYPE_INCOMPATIBLE_WITH_CAMPAIGN_TYPE' error. This error means that the given asset's type and the specified field type are incompatible, which means that the AD_IMAGE asset field type is incompatible with the campaign type Universal App campaign (UBERVERSAL). Universal App campaigns don't support image assets directly. I would suggest you use a different campaign type that supports the AD_IMAGE asset field type. Kindly refer to the document Assets to get more information on the supported asset types for different campaign types.

If you are still facing the issues, please share the customer ID in which the given campaign ID '20671574339' is present.

san...@knorex.com

unread,
Aug 29, 2024, 4:40:13 AM8/29/24
to Google Ads API and AdWords API Forum
Thanks your your info.

I have created the Image successfully in the SEARCH campaign.
However, the Google Ads manager doesn't show that new Image. The API returns its detail.

Account ID: 9841065000
Campaign ID: 21634268138
Asset ID: 93874744246

Martin
cp_lv_ext_martin.png

Google Ads API Forum Advisor

unread,
Aug 29, 2024, 9:36:24 AM8/29/24
to san...@knorex.com, adwor...@googlegroups.com
Hi Martin,

I can see the asset: 93874744246 under the Asset library in the Google Ads UI. Most asset types must be created using the AssetService before they can be used in an ad. After the asset has been created, the API returns a MutateAssetResult object that contains the resource name of the new ImageAsset. This resource name is used to reference the ImageAsset when creating an asset-based ad.

Looks like you have created an asset but not added this image asset to an Ad. I would recommend you refer to this guide on 'Use the asset in an ad' for information on adding an asset to an ad. So, this could be the reason that you are not able to see it under the Assets tab.

I hope this helps.

san...@knorex.com

unread,
Aug 29, 2024, 9:43:30 AM8/29/24
to Google Ads API and AdWords API Forum
Hi,

What I want is to add the Image to the "campaign" so that it can be used in all "ads" in that campaign.
You can see this photo for reference, the Image was created at the Campaign level from Google Ads manager.

Thanks.

img_asset.png

Google Ads API Forum Advisor

unread,
Aug 29, 2024, 2:03:47 PM8/29/24
to san...@knorex.com, adwor...@googlegroups.com
Hi,

Kindly note that different ad and campaign types support different asset types. Please refer to this guide for more information. I would recommend that you use CampaignAssetService to link the asset with the campaign. 

Hope this helps. If you have any more queries, please feel free to get back to us.

san...@knorex.com

unread,
Aug 29, 2024, 9:50:53 PM8/29/24
to Google Ads API and AdWords API Forum
Hi,

We used CampaignAssetService successfully link that Image to the campaign.
The problem here is that although it is successfully, the Google Ads campaign is not showing that Image in the campaign.

Here is the result:

results {
  asset {
    resource_name: "customers/9841065000/assets/93874744246"
    type: IMAGE
    image_asset {
      full_size {
        url: "https://tpc.googlesyndication.com/simgad/6609220437729732380"
      }
    }
    id: 93874744246
    name: "400x400.png"
  }
  campaign_asset {
    resource_name: "customers/9841065000/campaignAssets/21634268138~93874744246~AD_IMAGE"
    field_type: AD_IMAGE
    status: ENABLED
    campaign: "customers/9841065000/campaigns/21634268138"
    asset: "customers/9841065000/assets/93874744246"
  }
}

Here is the screenshot:
test_cp_level.png

Martin

Google Ads API Forum Advisor

unread,
Aug 30, 2024, 6:15:59 AM8/30/24
to san...@knorex.com, adwor...@googlegroups.com
Hi,

In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end.

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.


You can send the details via Reply privately to the author option, or direct private reply to this email.

 

san...@knorex.com

unread,
Aug 30, 2024, 7:12:50 AM8/30/24
to Google Ads API and AdWords API Forum
Hi,
Here is the logs:

Request
-------
MethodName: google.ads.googleads.v15.services.GoogleAdsService/Search

Endpoint: googleads.googleapis.com:443
Headers: {developer-token=REDACTED, login-customer-id=REDACTED, x-goog-api-client=gl-java/1.8.0_202 gccl/28.0.0 gapic/28.0.0 gax/2.32.0 grpc/1.56.1}
Body: customer_id: "9841065000"
query: "SELECT campaign_asset.asset, campaign_asset.campaign, campaign_asset.field_type, campaign_asset.resource_name, campaign_asset.status,asset.structured_snippet_asset.values, asset.structured_snippet_asset.header, asset.sitelink_asset.start_date, asset.sitelink_asset.link_text,asset.sitelink_asset.end_date, asset.sitelink_asset.description2, asset.sitelink_asset.description1, asset.sitelink_asset.ad_schedule_targets,asset.resource_name, asset.promotion_asset.redemption_start_date, asset.promotion_asset.start_date, asset.promotion_asset.redemption_end_date,asset.promotion_asset.promotion_target, asset.promotion_asset.promotion_code, asset.promotion_asset.percent_off,asset.promotion_asset.orders_over_amount.currency_code, asset.promotion_asset.orders_over_amount.amount_micros, asset.promotion_asset.occasion,asset.promotion_asset.money_amount_off.currency_code, asset.promotion_asset.money_amount_off.amount_micros, asset.promotion_asset.language_code,asset.promotion_asset.end_date, asset.promotion_asset.discount_modifier, asset.promotion_asset.ad_schedule_targets, asset.price_asset.type,asset.price_asset.price_qualifier, asset.price_asset.price_offerings, asset.price_asset.language_code, asset.policy_summary.review_status,asset.policy_summary.policy_topic_entries, asset.policy_summary.approval_status, asset.name, asset.lead_form_asset.privacy_policy_url,asset.lead_form_asset.post_submit_headline, asset.lead_form_asset.post_submit_description, asset.lead_form_asset.post_submit_call_to_action_type,asset.lead_form_asset.headline, asset.lead_form_asset.fields, asset.lead_form_asset.desired_intent, asset.lead_form_asset.description,asset.lead_form_asset.delivery_methods, asset.lead_form_asset.custom_disclosure, asset.lead_form_asset.call_to_action_type,asset.lead_form_asset.call_to_action_description, asset.lead_form_asset.business_name, asset.lead_form_asset.background_image_asset,asset.id, asset.hotel_callout_asset.text, asset.hotel_callout_asset.language_code, asset.final_urls, asset.final_url_suffix,asset.final_mobile_urls, asset.callout_asset.start_date, asset.callout_asset.end_date, asset.callout_asset.callout_text,asset.callout_asset.ad_schedule_targets, asset.call_to_action_asset.call_to_action, asset.call_asset.phone_number,asset.call_asset.country_code, asset.call_asset.call_conversion_reporting_state, asset.call_asset.call_conversion_action,asset.call_asset.ad_schedule_targets, asset.tracking_url_template, asset.type, asset.url_custom_parameters,asset.image_asset.full_size.url FROM campaign_asset WHERE campaign_asset.campaign = \'customers/9841065000/campaigns/21634268138\'  AND campaign_asset.status != \'REMOVED\' AND campaign_asset.field_type IN (\'AD_IMAGE\',\'BUSINESS_NAME\',\'BUSINESS_LOGO\')"


Response
--------
Headers: Metadata(content-disposition=attachment,content-type=application/grpc,request-id=3rIsfNCxb0alGacPq7p9dQ,date=Fri, 30 Aug 2024 11:10:01 GMT,alt-svc=h3=":443"; ma=2592000,h3-29=":443"; ma=2592000)
Body: results {

  asset {
    resource_name: "customers/9841065000/assets/93874744246"
    type: IMAGE
    image_asset {
      full_size {
        url: "https://tpc.googlesyndication.com/simgad/6609220437729732380"
      }
    }
    id: 93874744246
    name: "400x400.png"
  }
  campaign_asset {
    resource_name: "customers/9841065000/campaignAssets/21634268138~93874744246~AD_IMAGE"
    field_type: AD_IMAGE
    status: ENABLED
    campaign: "customers/9841065000/campaigns/21634268138"
    asset: "customers/9841065000/assets/93874744246"
  }
}
results {
  asset {
    resource_name: "customers/9841065000/assets/93928700067"
    type: IMAGE
    image_asset {
      full_size {
        url: "https://tpc.googlesyndication.com/simgad/1655154618071799261"
      }
    }
    id: 93928700067
    name: "600x314.png"
  }
  campaign_asset {
    resource_name: "customers/9841065000/campaignAssets/21634268138~93928700067~AD_IMAGE"
    field_type: AD_IMAGE
    status: ENABLED
Failure message: null
Status: Status{code=OK, description=null, cause=null}.

=======
As you can see, there are 2 images in the campaign, but they are not showing in campaign asset list.

Google Ads API Forum Advisor

unread,
Aug 30, 2024, 1:14:37 PM8/30/24
to san...@knorex.com, adwor...@googlegroups.com
Hi,

Allow me to check with the rest of our team with the information provided and one of our colleagues will reach out to you once we have an update on this issue.

Google Ads API Forum Advisor

unread,
Sep 3, 2024, 11:24:42 AM9/3/24
to adwor...@googlegroups.com, san...@knorex.com
Hi,

As the asset: 93874744246 can be retrieved via the Google Ads API, it is out of scope for our team to determine the reason that it is not visible in the UI. So, I would recommend you reach out to the Google Ads Product support team, as they are better equipped to assist you on this.

I hope this clarifies.

 
Reply all
Reply to author
Forward
0 new messages