Is it possible to upload image extensions as assets?

268 views
Skip to first unread message

Tommy Bradbury

unread,
Oct 21, 2022, 8:50:28 AM10/21/22
to Google Ads API and AdWords API Forum
hi guys, 

I am currently working through the API to upload and get reports of image extensions at a campaign, adgroup and overall level. 

Based on what I have read through and worked on so far, it seems that the current process stated in the documentation involves creating an image as an asset (this doc), and then for that to become an extension you must create a feed item and attach that to a campaign/ad group (this doc). I don't see anywhere in the documentation how I can add the image extension directly as an asset, in the way that you can with sitelinks for example (this doc).

when reading through this blog post though, I can see that feed based uploads are going to be deprecated shortly so I followed the migration procedure through and ended up with the following php code:
 
<?php
require "vendor/autoload.php";
use Google\Ads\GoogleAds\V10\Resources\CampaignAsset;
use Google\Ads\GoogleAds\V10\Resources\AdGroupAsset;
use Google\Ads\GoogleAds\V10\Services\CampaignAssetOperation;
use Google\Ads\GoogleAds\V10\Services\AdGroupAssetOperation;

$googleAdsClient = new GoogleClient();
$customerId = "123456789";
$adGroupId = "123456789";
$assetResourceName = "example/1234/example/1234";

$imageExtensionAdGroupAssetOperations = [
  new AdGroupAssetOperation(['create' => new AdGroupAsset([
    'asset' => $assetResourceName,
    'ad_group' => ResourceNames::forAdGroup($customerId, $adGroupId),
    'field_type' => AssetFieldType::MARKETING_IMAGE // also tried with AssetFieldType::SQUARE_MARKETING_IMAGE
  ])])
];

$adGroupAssetServiceClient = $googleAdsClient->getAdGroupAssetServiceClient();
$response = $adGroupAssetServiceClient->mutateAdGroupAssets(
  $customerId,
  $imageExtensionAdGroupAssetOperations
);

when I run this with both , I get the following error:

"The given field type is not supported to be added directly through asset links."

Are image extensions currently supported as assets? if so, is there any example code on this?

Google Ads API Forum Advisor

unread,
Oct 21, 2022, 11:03:04 AM10/21/22
to t...@tfli.co.uk, adwor...@googlegroups.com
Hi Tommy,

Thank you for raising your concern. I am a member of the Google Ads API team and let me provide support to your concern.

I completely understand your concern. To answer your questions in general, image extension as an asset is not supported in the Google Ads API as it is not included in the supported asset-based extension types mentioned on this document. This is the reason why you encountered the error as well. With this, you can only add the said type of extension via feed using this implementation.

Please follow our blog as we will post relevant updates there when it becomes supported. 

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cOpOU:ref
Reply all
Reply to author
Forward
0 new messages