0 | I am trying to create TrueView in-search video ad using adwords api with code as below and it does not accept display URL, i tried with different combination of display URL but error is still the same. Here is the code TemplateAd videoAd = new TemplateAd(); videoAd.setName("vidoolyVideoAd"); videoAd.setTemplateId(231l); videoAd.setFinalUrls(new String[] {"https://youtu.be/jbGkBDIMBW4"}); videoAd.setDisplayUrl("www.vidooly.com");
TemplateElementField headline = new TemplateElementField(); headline.setName("headline"); headline.setType(TemplateElementFieldType.TEXT); headline.setFieldText("kuchViBol");
TemplateElementField videoId = new TemplateElementField(); videoId.setName("videoId"); videoId.setType(TemplateElementFieldType.VIDEO); videoId.setFieldText("https://youtu.be/jbGkBDIMBW4");
TemplateElementField channelName = new TemplateElementField(); channelName.setName("channelName"); channelName.setType(TemplateElementFieldType.TEXT); channelName.setFieldText("youtube.com/Google");
TemplateElementField imageUrl = new TemplateElementField(); imageUrl.setName("imageUrl"); imageUrl.setType(TemplateElementFieldType.URL); imageUrl.setFieldText("http://vidooly.com/resources/v1/images/vidooly-yt-logo.png");
TemplateElement adData = new TemplateElement(); adData.setUniqueName("adData"); adData.setFields(new TemplateElementField[] {headline, videoId,imageUrl});
videoAd.setTemplateElements(new TemplateElement[] {adData});
AdGroupAd html5AdGroupAd = new AdGroupAd(); html5AdGroupAd.setAdGroupId(28619480966l); html5AdGroupAd.setAd(videoAd); // Optional: Set the status. html5AdGroupAd.setStatus(AdGroupAdStatus.PAUSED); // Create the operation. AdGroupAdOperation operation = new AdGroupAdOperation(); operation.setOperator(Operator.ADD); operation.setOperand(html5AdGroupAd);
AdGroupAdReturnValue result = adGroupAdService.mutate(new AdGroupAdOperation[] {operation}); followings is the error code [AdError.INVALID_YOUTUBE_DISPLAY_URL @ operations[0].operand.ad.displayUrl |