While create image ad , throws ImageError.UNEXPECTED_SIZE

573 views
Skip to first unread message

郭文豪

unread,
Feb 17, 2016, 11:55:43 PM2/17/16
to AdWords API Forum
Hello :D

Yesterday(GMT+8 2016/02/17) we've create an image ad successfully,

and today, while we are running the same test of creating an image ad with the same picture,

it throws   
      
             ImageError.UNEXPECTED_SIZE @ operations[0].operand.ad.image.dimensions.


Following is our dimensions:

+mediaId: "1657468999"

  +type: "IMAGE"

  +referenceId: "-71115230096130048"

  +dimensions: array:3 [▼

    0 => Media_Size_DimensionsMapEntry {#447 ▼

      +key: "FULL"

      +value: Dimensions {#442 ▼

        +width: 300

        +height: 250

      }

    }

    1 => Media_Size_DimensionsMapEntry {#423 ▼

      +key: "PREVIEW"

      +value: Dimensions {#420 ▼

        +width: 120

        +height: 100

      }

    }

    2 => Media_Size_DimensionsMapEntry {#417 ▼

      +key: "SHRUNKEN"

      +value: Dimensions {#441 ▼

        +width: 300

        +height: 239

      }

    }

  ]

  +urls: array:3 [▼

    0 => Media_Size_StringMapEntry {#431 ▼

      +key: "FULL"

      +value: "https://tpc.googlesyndication.com/simgad/7741862863337376761"

    }

    1 => Media_Size_StringMapEntry {#381 ▼

      +key: "PREVIEW"

      +value: "https://tpc.googlesyndication.com/simgad/2253206294676374084"

    }

    2 => Media_Size_StringMapEntry {#448 ▼

      +key: "SHRUNKEN"

      +value: "https://tpc.googlesyndication.com/simgad/18064973949192049286"

    }

  ]

  +mimeType: "IMAGE_JPEG"

  +sourceUrl: ""

  +name: ""

  +fileSize: 50952

  +creationTime: null

  +MediaType: "Image"

  -_parameterMap: array:1 [▼

    "Media.Type" => "MediaType"

  ]


Is there any problem ?


Thanks :D


郭文豪

unread,
Feb 18, 2016, 12:03:12 AM2/18/16
to AdWords API Forum

And this is our request :



HTTP/1.1 200 OK

Content-Type: text/xml; charset=UTF-8

Content-Encoding: gzip

Date: Thu, 18 Feb 2016 04:50:11 GMT

Expires: Thu, 18 Feb 2016 04:50:11 GMT

Cache-Control: private, max-age=0

X-Content-Type-Options: nosniff

X-Frame-Options: SAMEORIGIN

X-XSS-Protection: 1; mode=block

Content-Length: 600

Server: GSE


<?xml version="1.0"?>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

  <soap:Header>

    <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201601">

      <requestId>00052c0419f902100a4c0848a5033c36</requestId>

      <serviceName>MediaService</serviceName>

      <methodName>upload</methodName>

      <operations>1</operations>

      <responseTime>572</responseTime>

    </ResponseHeader>

  </soap:Header>

  <soap:Body>

    <uploadResponse xmlns="https://adwords.google.com/api/adwords/cm/v201601">

      <rval xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Image">

        <mediaId>1656191036</mediaId>

        <type>IMAGE</type>

        <referenceId>-8865519402443866112</referenceId>

        <dimensions>

          <key>PREVIEW</key>

          <value>

            <width>120</width>

            <height>100</height>

          </value>

        </dimensions>

        <dimensions>

          <key>SHRUNKEN</key>

          <value>

            <width>300</width>

            <height>239</height>

          </value>

        </dimensions>

        <dimensions>

          <key>FULL</key>

          <value>

            <width>300</width>

            <height>250</height>

          </value>

        </dimensions>

        <urls>

          <key>PREVIEW</key>

          <value>https://tpc.googlesyndication.com/simgad/11315244514801988532</value>

        </urls>

        <urls>

          <key>SHRUNKEN</key>

          <value>https://tpc.googlesyndication.com/simgad/15118144346765480802</value>

        </urls>

        <urls>

          <key>FULL</key>

          <value>https://tpc.googlesyndication.com/simgad/16225239531049802123</value>

        </urls>

        <mimeType>IMAGE_JPEG</mimeType>

        <sourceUrl/>

        <name/>

        <fileSize>50952</fileSize>

        <Media.Type>Image</Media.Type>

      </rval>

    </uploadResponse>

  </soap:Body>

</soap:Envelope>

Yin Niu

unread,
Feb 18, 2016, 9:33:53 AM2/18/16
to AdWords API Forum
Hello, 

The error occurred because the image sizes do not meet requirements. Please check out the static image ads specs

Thanks,
Yin, AdWords API Team. 

Yu-Juei Tseng

unread,
Feb 18, 2016, 11:16:44 AM2/18/16
to AdWords API Forum

His image size is 300, 250 in FULL Dimension.
This is valid
in image ads specs.



Yin Niu於 2016年2月18日星期四 UTC+8下午10時33分53秒寫道:

Yin Niu

unread,
Feb 19, 2016, 9:18:03 AM2/19/16
to AdWords API Forum
Hello, 

Please send the SOAP response as well. 
Message has been deleted

Yu-Juei Tseng

unread,
Feb 20, 2016, 6:31:36 AM2/20/16
to AdWords API Forum
We try to create image ad.
But it get fault with use AdGroupAdService.


Yin Niu於 2016年2月19日星期五 UTC+8下午10時18分03秒寫道:

Thanet Knack Praneenararat (AdWords API Team)

unread,
Feb 21, 2016, 10:33:41 PM2/21/16
to adwor...@googlegroups.com
Hi Yu-Juei,

We've got a log from rocko lo already but I needed to delete that post as it contains private information like developer token and customer ID.
We're investigating this issue and will get back to you once I have an update.

Best,
Thanet, AdWords API Team

Yu-Juei Tseng

unread,
Feb 21, 2016, 10:47:22 PM2/21/16
to AdWords API Forum
Hi Thanet,

Thank your help. We will wait your response.

Yu-Juei

Thanet Knack Praneenararat (AdWords API Team)於 2016年2月22日星期一 UTC+8上午11時33分41秒寫道:
Hi Yu-Juei,

We have a got a log from rocko lo already but I needed to delete that post as it contains private information like developer token and customer ID.

Thanet Knack Praneenararat (AdWords API Team)

unread,
Feb 22, 2016, 8:18:22 PM2/22/16
to AdWords API Forum
Hi Yu-Juei,

In your SOAP log, it seems you've set both image's data and mediaId.
You're not supposed to provide both data. 
Could you please try using only data?
Or if you have existing image you want to use, you may use mediaId instead.

Cheers,
Thanet, AdWords API Team

rocko Lo

unread,
Feb 23, 2016, 3:43:56 AM2/23/16
to AdWords API Forum
 Hi Thanet,
 
We followed your suggest to create IMAGE AD via set data.

And now, I have a question that is how to use the mediaId to create a IMAGE AD?

The following is our SOAP data


Thanks


  
 
soap_xml.log

Thanet Knack Praneenararat (AdWords API Team)

unread,
Feb 23, 2016, 3:59:59 AM2/23/16
to AdWords API Forum
Hi Rocko,

Which one is your SOAP request in question? The last one in the file?
As for your question, I think mediaId is used by setting your existing images as a new ImageAd.
I have not tested this yet, but mostly mediaIds are used to create a TemplateAd, as written in the overview of this page.

In case you have a brand-new image to create as an ImageAd, you should set only data, not the mediaId.

Best,
Thanet, AdWords API Team

rocko Lo

unread,
Feb 23, 2016, 4:54:29 AM2/23/16
to AdWords API Forum
Hi Thanet,

Yes, it's last one file.
About the last SOAP data, we found that if we use imageId the same way we use to create imageAd, it shows same error message:

"ImageError.UNEXPECTED_SIZE @ operations[0].operand.ad.image.dimensions."

And we have create TemplateAd for templateId is 432 the same issue.

Please let me know if there's any question

Thanet Knack Praneenararat (AdWords API Team)

unread,
Feb 23, 2016, 6:36:39 AM2/23/16
to AdWords API Forum
Hi Rocko,

Thanks for update.
I'm passing this info to the person in charge.
Do you have a failing SOAP log for TemplateAd creation as well? 
Please filter out all unrelated SOAP logs and send the log to me by Reply privately to author.

Best,
Thanet

fingat...@gmail.com

unread,
Jul 1, 2016, 4:33:18 AM7/1/16
to AdWords API Forum
Hello.
Do you solve your problem? I have same problem with 'AdwordsApi::V201605::AdGroupAdService::ApiException:
       [ImageError.UNEXPECTED_SIZE @ operations[0].operand.ad.image.data]'
Can you help me?

вторник, 23 февраля 2016 г., 14:36:39 UTC+3 пользователь Thanet Knack Praneenararat (AdWords API Team) написал:

Thanet Knack Praneenararat (AdWords API Team)

unread,
Jul 1, 2016, 10:36:32 AM7/1/16
to AdWords API Forum
Hello,

Could you please send your SOAP logs by Reply privately to author?
The previous issue has been solved and I'm not sure what you're faced with is the same problem.

Cheers,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages