Hello,

 168 x 48 isn't a valid image dimension. The list of valid image
dimensions is at

  
http://code.google.com/intl/en/apis/adwords/docs/developer/MobileImageAd.html#image

The closest to what you're attempting is 168 x 42.

Cheers,
-Jeff Posnick, AdWords API Team


On Dec 23, 6:35 am, API-User <christian.borm...@comarch.com> wrote:
> I am using the .net client library and I am not able to ad an
> MobileImageAd via API.
> If I use the code below I get an exception saying that I tried to ad
> an image with no valid dimensions.
> The image itself is 168x42 and does not violate the MobileImageAd
> format specification.
>
> The code I used is as followed:
>
>  MobileImageAd ad = new MobileImageAd();
>  ad.adGroupId = 123;
>  ad.displayUrl = displayUrl;
>  ad.markupLanguages = new string[]{"HTML"};
>  ad.mobileCarriers = new string[]{"ALLCarriers"};
>  ad.adType = MobileImageAd;
>  ad.adTypeSpecified = true;
>
> FileStream fs = File.OpenRead("image_path");
> byte[] imgData = new byte[fs.Length];
> fs.Read(imgData, 0, imgData.Length);
> fs.Close();
> Image img = new Image();
> img.data = imgData;
> img.name = "name";
> img.width = 168;
> img.widthSpecified = true;
> img.height = 48;
> img.heightSpecified = true;
> ad.image = img;
>
> AdService service = (AdService)user.getService("AdService");
> service.addAds(new Ad[] { ad });
>
> Regards
> API-User
>
> On Dec 15, 6:44 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
> wrote:
>
> > Hello Edmond,
>
> >  I just wanted to follow up on this.
>
> >  Much like the earlier issue with LocalBusinessAd image sizes, the
> > specific size requirements of theMobileImageAddo cause the canned
> > images to trigger errors in the Sanbdox. This would have to be
> > addressed with adjustments to the Sandbox codebase.
>
> >  As for production use, MobileImageAds are treated a bit different
> > from other ad types (I don't think this was intentional). One
> > difference is, as you pointed out, that the <image> element needs the
> > height and width attributes set, while when creating a normal Image ad
> > this isn't necessary. Another difference is that the AdWords v13
> > namespace is *required* for the <ads> element in order for an addAds()
> > call to be successful. (If you leave it out, you'll get the generic
> > "An internal error has occurred." SOAP fault.) Also, specifying
> > "MobileImageAd" in the <adType> element doesn't seem to be sufficient;
> > you need to set the ad type in the xsi:type attribute of the <ads>
> > element. I don't believe that this was intentional either.
>
> >  I've brought this all to the attention of the core engineering team,
> > and at the very least we'll need to update the documentation in the
> > Developer's Guide to reflect this. Alternatively, the behavior may be
> > changed so that MobileImageAds behave much more like regular Image ads
> > and the other ad types. I don't know at the moment what approach will
> > be taken. I do want to provide an example of the SOAP body of a
> > properly formatted call to addAds() for aMobileImageAdto save others
> > the trouble of getting everything right in the meantime.
>
> > <soap:Body>
> >   <addAds>
> >     <ads xsi:type="MobileImageAd" xmlns="https://adwords.google.com/
> > api/adwords/v13">
> >       <adGroupId>123456</adGroupId>
> >       <destinationUrl>http://destination.url.com/0</destinationUrl>
> >       <displayUrl>destination.url.com</displayUrl>
> >       <status>Enabled</status>
> >       <image>
> >         <data>*BASE_64_DATA*</data>
> >         <height>28</height>
> >         <width>168</width>
> >       </image>
> >       <markupLanguages>HTML</markupLanguages>
> >       <mobileCarriers>ALLCARRIERS</mobileCarriers>
> >     </ads>
> >   </addAds>
> > </soap:Body>
>
> >  I haven't yet tested this in all the different client libraries to
> > see which will produce XML that complies with that format.
>
> > Cheers,
> > -Jeff Posnick, AdWords API Team
>
> > On Nov 18, 5:18 pm, AdWords API Advisor <adwordsapiadvi...@google.com>
> > wrote:
>
> > > Hello Edmond,
>
> > >  I'm assuming that this is similar to the issues the Sandbox had with
> > > LocalBusinessAd image sizes, and which required some backend changes
> > > to resolve. I'll let the engineering team know about that and find out
> > > what the situation is with required height/width fields.
>
> > > Cheers,
> > > -Jeff Posnick, AdWords API Team
>
> > > On Nov 17, 3:43 pm, edmond <edmond2...@gmail.com> wrote:
>
> > > > Problem:
> > > > v13: Fails in sandbox, the static image width and height returned by
> > > > sandbox violates theMobileImageAdimage format.
> > > > Additionally, for it to pass creation in production the image size
> > > > must be set regardless of image format compliance or an exception:
> > > > invalid deminsion format is returned for a newMobileImageAdimage.
>
> > > > However, the width and height is not a requirement when creating an
> > > > ImageAd image if the image conforms to ImageAd formats.
>
> > > > I am well aware of the format size differences between the two Ad
> > > > types, merely that 1) production works but does not conform to the
> > > > API, 2) sandbox static dimension values don't allowMobileImageAd
> > > > creation.
>
> > > > Question:
> > > > Are there new validations forMobileImageAdimage dimensions while no
> > > > validation for ImageAd image dimensions?
> > > > Will sandbox provide a fix for the new image constraints?
> > > > Will production provide a fix for reading the dimensions from the
> > > > image?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to 
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to