Deleting Bidding Schemes fails

64 views
Skip to first unread message

Daniel Olel

unread,
Nov 10, 2014, 6:01:18 AM11/10/14
to adwor...@googlegroups.com

Hello!

Situation: I am writing an implementation to create and delete bidding schemes programmatically. The creating part is working just fine, but whenever I attempt to delete and already existing bidding scheme, it raises an exception.
The exception started when I upgraded to the new API v201409, it was working fine in the last version of the API

Any help is highly appreciated.

Danial Klimkin

unread,
Nov 10, 2014, 9:19:44 AM11/10/14
to adwor...@googlegroups.com
Hello Daniel,


What is the error message you are getting? Is it a shared (isExplicitShared = true) strategy? Do you have active campaigns linked with it?


-Danial, AdWords API Team.

Daniel Olel

unread,
Nov 10, 2014, 11:17:53 AM11/10/14
to adwor...@googlegroups.com
Yes, it's a shared bidding strategy. It doesn't have active campaigns linked to it in production since it's an account I use for testing the program before deploying it to production

Daniel Olel

unread,
Nov 10, 2014, 12:36:26 PM11/10/14
to adwor...@googlegroups.com
This is the Fault/Error the server sends back when I attempt to remove a bidding strategy
'[EntityNotFound.INVALID_ID @ operations[0].operand.id; trigger:'BiddingStrategyId: .[BidStrategyId]']'

This happens if I check first if the bidding strategy exists and it always gives this response
(SharedBiddingStrategy){
   id = [BiddingStrategyId - usually the ID of my test account]
   name = [BiddingStrategyNameChosen]
   status = "REMOVED"
 }

Danial Klimkin

unread,
Nov 11, 2014, 9:50:51 AM11/11/14
to adwor...@googlegroups.com
Hello Daniel,


Could you please enable XML logging and confirm the ID is inserted properly? It looks like the correct ID is not sent.


-Danial, AdWords API Team.

Daniel Olel

unread,
Nov 11, 2014, 11:22:40 AM11/11/14
to adwor...@googlegroups.com
So, Here is what happens, 
When I attempt to create a new shared strategy since the other one was removed, it returns an ERROR - ERROR TYPE <type 'exceptions.AttributeError'> from the Google Adwords API

These are the logs I get when I enable SOAP logging
<!-- Sending -->
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Header>
<tns:RequestHeader>
<tns:userAgent>rocket_adwords (AwApi-Python, googleads/2.1.0, Python/2.7)</tns:userAgent>
<tns:validateOnly>false</tns:validateOnly>
<tns:partialFailure>false</tns:partialFailure>
</tns:RequestHeader>
</SOAP-ENV:Header>
<ns1:Body>
<ns0:get>
<ns0:selector>
<ns0:fields>Name</ns0:fields>
<ns0:fields>Id</ns0:fields>
<ns0:fields>Status</ns0:fields>
<ns0:fields>Type</ns0:fields>
<ns0:predicates>
<ns0:field>Name</ns0:field>
<ns0:operator>EQUALS</ns0:operator>
<ns0:values>TEST</ns0:values>
</ns0:predicates>
<ns0:predicates>
<ns0:field>Status</ns0:field>
<ns0:operator>IN</ns0:operator>
<ns0:values>ENABLED</ns0:values>
</ns0:predicates>
<ns0:paging>
<ns0:startIndex>0</ns0:startIndex>
<ns0:numberResults>100</ns0:numberResults>
</ns0:paging>
</ns0:selector>
</ns0:get>
</ns1:Body>
</SOAP-ENV:Envelope>



<!-- Receiving -->
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<requestId>000507979125a1e10ac4a548170008fa</requestId>
<serviceName>BiddingStrategyService</serviceName>
<methodName>get</methodName>
<operations>1</operations>
<responseTime>314</responseTime>
</ResponseHeader>
</soap:Header>
<soap:Body>
<rval>
<totalNumEntries>0</totalNumEntries>
<Page.Type>BiddingStrategyPage</Page.Type>
</rval>
</getResponse>
</soap:Body>
</soap:Envelope>

Danial Klimkin

unread,
Nov 12, 2014, 9:20:20 AM11/12/14
to adwor...@googlegroups.com
Hello Daniel,


I am confused about what step you are facing the issue at?

Also, we recommend sending clientCustomerId in the SOAP header to ensure you are running the request against the correct account.


-Danial, AdWords API Team.

Daniel Olel

unread,
Nov 12, 2014, 11:50:24 AM11/12/14
to adwor...@googlegroups.com
Hello Danial, 

So here is the issue, Whenever I attempt to remove a shared bidding strategy, it returns an Invalid ID Error, which according to the API is an EntityNotFound Error.
Now if I query the API for removed shared bidding strategy, it returns one whose status I set to removed in an operation before.
But if I attempt to create a new shared bidding strategy, it throws the above AttributeError Exception.

As regards to the clientCustomerId, I do send that in the SOAP header but I still get the exception.

Danial Klimkin

unread,
Nov 13, 2014, 8:53:18 AM11/13/14
to adwor...@googlegroups.com
Hello Daniel,


Is it possible you accidentally send several operations in the same request for the same ID?

Please send us full XML code for the remove request and server response.


-Danial, AdWords API Team.

Daniel Olel

unread,
Nov 19, 2014, 6:05:32 AM11/19/14
to adwor...@googlegroups.com
Hi Danial, 

Here is the SOAP XML request for removing a bid strategy
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Header>
<tns:RequestHeader>
<tns:userAgent>rocket_adwords (AwApi-Python, googleads/2.1.0, Python/2.7)</tns:userAgent>
<tns:validateOnly>false</tns:validateOnly>
<tns:partialFailure>false</tns:partialFailure>
</tns:RequestHeader>
</SOAP-ENV:Header>
<ns1:Body>
<ns0:mutate>
<ns0:operations>
<ns0:operator>REMOVE</ns0:operator>
<ns0:operand>
<ns0:id>631122550</ns0:id>
<ns0:name>TEST</ns0:name>
<ns0:status>REMOVED</ns0:status>
<ns0:type>PAGE_ONE_PROMOTED</ns0:type>
</ns0:operand>
</ns0:operations>
</ns0:mutate>
</ns1:Body>
</SOAP-ENV:Envelope>

And here is the server response
Server raised fault: '[EntityNotFound.INVALID_ID @ operations[0].operand.id; trigger:'BiddingStrategyId: 631122550']'

Danial Klimkin

unread,
Nov 19, 2014, 9:36:36 AM11/19/14
to adwor...@googlegroups.com
Hello Daniel,


First of all, please add the clientCustomerId header to the request. This way we can confirm which account the request is executed against.

As per the error, where do you get the strategy ID from? ID 631122550 is not a valid bidding strategy ID.


-Danial, AdWords API Team.

Daniel Olel

unread,
Nov 19, 2014, 9:50:23 AM11/19/14
to adwor...@googlegroups.com
Hi, 

I do added the clientCustomerId and developerToken header to the request and still got the error.
As for the strategy Id, I pass the strategy object I retrieved from the query for an existing strategy of the given name

On Wednesday, 19 November 2014 15:36:36 UTC+1, Danial Klimkin wrote:
Hello Daniel,


First of all, please add the clientCustomerId header to the request. This way we can confirm which account thle request is executed against.

Daniel Olel

unread,
Nov 24, 2014, 11:12:27 AM11/24/14
to adwor...@googlegroups.com
Hi Danial, 

Is there any more information that I need to bring for this issue?

Kind Regards, 
Daniel Olel

Danial Klimkin

unread,
Nov 25, 2014, 8:48:45 AM11/25/14
to adwor...@googlegroups.com
Hi Daniel,


Could you please send us an example of this get request, you take the bidding strategy ID from?


-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages