When you create a series, you upload HTML5 and make a mistake.

145 views
Skip to first unread message

mengju...@gmail.com

unread,
Jan 10, 2018, 1:56:04 AM1/10/18
to AdWords API Forum
Collection<File> uploadMediaBundles = FileUtils.listFiles(new File(campaignItem.html5_path), null, false);
if (uploadMediaBundles.size() > 0) {
MediaServiceInterface mediaService =
adWordsServices.get(session, MediaServiceInterface.class);
ArrayList<MediaBundle> mediaBundles = new ArrayList<>();
ArrayList<String> md5List = new ArrayList<>();
for (File file : uploadMediaBundles) {
String fileName = file.getAbsolutePath().toLowerCase();
if (fileName.endsWith("zip")) {
MediaBundle mediaBundle = new MediaBundle();
mediaBundle.setData(
com.google.api.ads.common.lib.utils.Media.getMediaDataFromFile(file));
mediaBundle.setType(MediaMediaType.MEDIA_BUNDLE);

mediaBundles.add(mediaBundle);
}
}
if (mediaBundles.size() > 0) {
Media[] media = new Media[mediaBundles.size()];
for (int i = 0; i < mediaBundles.size(); i++) {
media[i] = mediaBundles.get(i);
}

Media[] result = mediaService.upload(media);


long[] mediaIds = new long[result.length];
for (int i = 0; i < result.length; i++) {
mediaIds[i] = result[i].getMediaId();
}
universalAppSetting.setImageMediaIds(mediaIds);
}
}

CampaignService Method: mutate clientCustomerId: 590-416-6793 URL: https://adwords.google.com/api/adwords/cm/v201708/CampaignService Request ID: 0005626678a389790a6267986302ce02 ResponseTime(ms): 497 OperationsCount: 1 IsFault: true FaultMessage: ApiException{applicationExceptionType=ApiException, errors=[SettingError{apiErrorType=SettingError, errorString=SettingError.MEDIA_INCOMPATIBLE_FOR_UNIVERSAL_APP_CAMPAIGN, fieldPath=operations[0].operand.settings[0].imageMediaIds[0], fieldPathElements=[FieldPathElement{field=operations, index=0}, FieldPathElement{field=operand}, FieldPathElement{field=settings, index=0}, FieldPathElement{field=imageMediaIds, index=0}], reason=MEDIA_INCOMPATIBLE_FOR_UNIVERSAL_APP_CAMPAIGN, trigger=3356164502}]}

Vincent Racaza (AdWords API Team)

unread,
Jan 10, 2018, 3:52:19 AM1/10/18
to AdWords API Forum
Hi,

From the MEDIA_INCOMPATIBLE_FOR_UNIVERSAL_APP_CAMPAIGN error itself, it means that you are referencing an unsupported media type for the universal app campaign. The imageMediaIds of a universal app campaign only supports landscape images and not an HTML5  or MEDIA_BUNDLE type.

Please set an IMAGE media type for a universal app campaign and let me know if you encounter any issues after doing this.

Thanks,
Vincent
AdWords API Team

mengju...@gmail.com

unread,
Jan 10, 2018, 5:07:36 AM1/10/18
to AdWords API Forum
I still want to upload html5 in AUC, what should I do?

在 2018年1月10日星期三 UTC+8下午2:56:04,mengju...@gmail.com写道:

Vincent Racaza (AdWords API Team)

unread,
Jan 10, 2018, 10:39:03 PM1/10/18
to AdWords API Forum
Hi,

As I have said previously, only the IMAGE media type is currently supported for UAC campaigns via the AdWords API. The YoutubeVideoMedia and the HTML5 assets are still not supported for UAC campaigns. You can check this guide for more information regarding UAC campaigns. If you really want to add an HTML5 asset in your UAC campaign, then you need to add this via the AdWords UI.

As for the HTML5 asset which is supported in the API, this is only available in template ads under other campaign types which are non-UAC campaigns.
Reply all
Reply to author
Forward
0 new messages