Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

SaveAd using python api 1.15 No error message, but No new ad created

27 views
Skip to first unread message

zamplus zamplus

unread,
Oct 28, 2011, 9:26:07 AM10/28/11
to Google's DoubleClick for Advertisers API Forum
Hello,

I am trying to explicitly create a new default ad using the DFA
API v1.15. python.

The campaign and creative are already created and ready to go.
After SaveAd , I got no error, but there is no new Ad created.

I am unsure on how to resolve this. Any help will be appreciated.

Here is some example code of what I am attempting. Thanks.

image_ad ={
'xsi_type': 'DefaultAd',
'name':u'testtesttest',
'id': '0',
'active': u'false',
'archived': u'false',
'campaignId':campaign_id,
'endTime' : end_date,
'startTime': start_date,
'sizeId':size_id,
'typeId': my_enums.DFA_STANDARD_AD,
'creativeAssignment':{
'active':u'True',
'startDate': start_date,
'endDate': end_date,
'creativeId':creativeId,
'sequence': u'1',
'weight': u'1',
'clickThroughUrl':{
'customClickThroughUrl':u'http://www.baidu.com',
'defaultLandingPageUsed':u'False',
'landingPageId':u'0'
},
},
}
ad_service.SaveAd(image_ad)

*** Incoming HTTP headers
**********************************************
HTTP/1.? 200 OK
Content-Type: text/xml;charset=utf-8
Vary: Accept-Encoding
Date: Fri, 28 Oct 2011 12:51:28 GMT
Server: Google
************************************************************************
*** Incoming SOAP
******************************************************
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/
envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<saveAdResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/
soap/encoding/">
<ns1:AdSaveResult href="#id0" xmlns:ns1="http://www.doubleclick.net/
dfa-api/v1.15"/>
</saveAdResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://
schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://
www.doubleclick.net/dfa-api/v1.15" xmlns:soapenc="http://
schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:AdSaveResult">
<id xsi:type="xsd:long">0</id>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
************************************************************************

DFA API Advisor

unread,
Oct 28, 2011, 10:55:22 AM10/28/11
to Google's DoubleClick for Advertisers API Forum
Hello there!

Hmm, this is interesting. One thing I think may be a problem is that
your typeId is set to Standard Ad, but DefaultAds have their own type
ID numbers. You can find the listing here:
http://code.google.com/apis/dfa/docs/creative_types.html#ads You
probably want ID 13 or 14, while Standard Ads are type 1.

There are other reasons this DefaultAd may be a problem. Do you
already have a DefaultAd of the same dimensions (sizeId) in this
campaign? You're only allowed to have 1 default ad for each slot size
per campaign.

In troubleshooting this issue, I've noticed that saving a faulty
DefaultAd seems to give a success message with a returned ID of 0, as
it did for you. This is a problem unique to the DefaultAd ad type. I
will bring this issue up and try to get better error messages attached
to these ads.

Let me know if neither of these suggestions helps.

Cheers,
- Joseph DiLallo, the DFA API Team
> schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://www.doubleclick.net/dfa-api/v1.15" xmlns:soapenc="http://
Reply all
Reply to author
Forward
0 new messages