Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Last and final update.

I tested and I can pull the Criteria ID for item IDs and utilize this code 
to update their CPC.

Thank you for all your help Josh and Anup.



On Monday, May 2, 2016 at 10:26:24 AM UTC-5, Kevin Weitzner wrote:
>
> Fixed - changed the operator to "SET" rather than add.
>
> Final code that works... I cannot modify productID level CPCs yet .. so 
> not ideal however this will suffice I think, I am not sure how to utilize 
> suggestions that Josh has offered.
> --
> def main(client):
> adgroup_criterion_service = 
> client.GetService('AdGroupCriterionService', version='v201603')
>
>
> bid_modifier = '150'
>#1.50 bid in microns
> operation = {
> 'xsi_type':'AdGroupCriterionOperation',
> 'operator': 'SET',
>
> 'operand': {
> 'xsi_type': 'BiddableAdGroupCriterion',
> 'adGroupId': ad_group_id,
> 'criterion': {
> 'xsi_type': 
> 'ProductPartition',
> 'id': criterion_id,
> 
> 'partitionType':'SUBDIVISION'
> },
> 'biddingStrategyConfiguration': {
> 
>  'bids': [{
>   
>  'xsi_type': 'CpcBid',
>   
>  'bid': {
>   
>'microAmount': str(bid_modifier)
>   
>  },
>   
>  }]
> }
> }
> }
>
>
>
>
>
> result = adgroup_criterion_service.mutate(operation)
>
>
>
>
> if __name__ == '__main__':
>   adwords_client = 
> adwords.AdWordsClient.LoadFromStorage('*.yaml')
>   main(adwords_client)
>
> On Monday, May 2, 2016 at 10:23:06 AM UTC-5, Kevin Weitzner wrote:
>>
>> I modified the code and now receive invalid bid error(was receiving 
>> invalid parititon type earlier so I added it in):
>> suds.WebFault: Server raised fault: '[BiddingErrors.INVALID_BID @ 
>> operations[0].operand.biddingStrategyConfiguration.bids; 
>> trigger:'CpcBid{bid=1.50, contentBid=null, cpcBidSource=null}']'
>>
>>
>> I've tried putting in various bids..
>>
>> operation = {
>> 'xsi_type':'AdGroupCriterionOperation',
>> 'operator': 'ADD',
>>
>> 'operand': {
>> 'xsi_type': 
>> 'BiddableAdGroupCriterion',
>> 'adGroupId': ad_group_id,
>> 'criterion': {
>> 'xsi_type': 
>> 'ProductPartition',
>> 'id': criterion_id,
>> 
>> *'partitionType':'SUBDIVISION'*
>> },
>> 'biddingStrategyConfiguration': {
>> 
>>  'bids': [{
>>   
>>  'xsi_type': 'CpcBid',
>>   
>>  'bid': {
>>   
>>'microAmount': str(bid_modifier)
>>   
>>  },
>>   
>>  }]
>> }
>> }
>> }
>>
>> On Monday, May 2, 2016 at 10:12:54 AM UTC-5, Kevin Weitzner wrote:
>>>
>>> Hi Anup,
>>>
>>> Is there a way to obtain criteria Id for actual product IDs for items? 
>>>  Or is there an easy way to obtain criteria id?  I created a 
>>> Product_Partition_report for a different adgroup since my actual test one 
>>> was not showing up (not live campaign).
>>>
>>> I got the CriterionId and ran it and got this error:
>>> suds.WebFault: Server raised fault: '[RequiredError.REQUIRED @ 
>>> operations[0].operand.criterion.partitionType]'
>>>
>>> I picked a simple one with no underlying partitions -
>>> http://i.imgur.com/ABqO23Y.png
>>>
>>> I also tried one with subdivsions 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Fixed - changed the operator to "SET" rather than add.

Final code that works... I cannot modify productID level CPCs yet .. so not 
ideal however this will suffice I think, I am not sure how to utilize 
suggestions that Josh has offered.
--
def main(client):
adgroup_criterion_service = 
client.GetService('AdGroupCriterionService', version='v201603')


bid_modifier = '150'
   #1.50 bid in microns
operation = {
'xsi_type':'AdGroupCriterionOperation',
'operator': 'SET',

'operand': {
'xsi_type': 'BiddableAdGroupCriterion',
'adGroupId': ad_group_id,
'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id,

'partitionType':'SUBDIVISION'
},
'biddingStrategyConfiguration': {

 'bids': [{

   'xsi_type': 'CpcBid',

   'bid': {

 'microAmount': str(bid_modifier)

   },

   }]
}
}
}





result = adgroup_criterion_service.mutate(operation)




if __name__ == '__main__':
  adwords_client = 
adwords.AdWordsClient.LoadFromStorage('*.yaml')
  main(adwords_client)

On Monday, May 2, 2016 at 10:23:06 AM UTC-5, Kevin Weitzner wrote:
>
> I modified the code and now receive invalid bid error(was receiving 
> invalid parititon type earlier so I added it in):
> suds.WebFault: Server raised fault: '[BiddingErrors.INVALID_BID @ 
> operations[0].operand.biddingStrategyConfiguration.bids; 
> trigger:'CpcBid{bid=1.50, contentBid=null, cpcBidSource=null}']'
>
>
> I've tried putting in various bids..
>
> operation = {
> 'xsi_type':'AdGroupCriterionOperation',
> 'operator': 'ADD',
>
> 'operand': {
> 'xsi_type': 'BiddableAdGroupCriterion',
> 'adGroupId': ad_group_id,
> 'criterion': {
> 'xsi_type': 
> 'ProductPartition',
> 'id': criterion_id,
> 
> *'partitionType':'SUBDIVISION'*
> },
> 'biddingStrategyConfiguration': {
> 
>  'bids': [{
>   
>  'xsi_type': 'CpcBid',
>   
>  'bid': {
>   
>'microAmount': str(bid_modifier)
>   
>  },
>   
>  }]
> }
> }
> }
>
> On Monday, May 2, 2016 at 10:12:54 AM UTC-5, Kevin Weitzner wrote:
>>
>> Hi Anup,
>>
>> Is there a way to obtain criteria Id for actual product IDs for items? 
>>  Or is there an easy way to obtain criteria id?  I created a 
>> Product_Partition_report for a different adgroup since my actual test one 
>> was not showing up (not live campaign).
>>
>> I got the CriterionId and ran it and got this error:
>> suds.WebFault: Server raised fault: '[RequiredError.REQUIRED @ 
>> operations[0].operand.criterion.partitionType]'
>>
>> I picked a simple one with no underlying partitions -
>> http://i.imgur.com/ABqO23Y.png
>>
>> I also tried one with subdivsions and got the same error.  Any ideas? 
>>  Once I have this working I will try to expand it so that I can explode our 
>> ProductIds from what Josh stated earlier.. I'm not sure why this is so 
>> difficult for me.
>> --
>>
>>
>>
>> On Monday, May 2, 2016 at 9:35:37 AM UTC-5, Anup Pathak wrote:
>>>
>>> Hi Kevin,
>>>
>>>
>>> You have to take Criteria id from PRODUCT_PARTITION_REPORT and use that 
>>> 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
I modified the code and now receive invalid bid error(was receiving invalid 
parititon type earlier so I added it in):
suds.WebFault: Server raised fault: '[BiddingErrors.INVALID_BID @ 
operations[0].operand.biddingStrategyConfiguration.bids; 
trigger:'CpcBid{bid=1.50, contentBid=null, cpcBidSource=null}']'


I've tried putting in various bids..

operation = {
'xsi_type':'AdGroupCriterionOperation',
'operator': 'ADD',

'operand': {
'xsi_type': 'BiddableAdGroupCriterion',
'adGroupId': ad_group_id,
'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id,

*'partitionType':'SUBDIVISION'*
},
'biddingStrategyConfiguration': {

 'bids': [{

   'xsi_type': 'CpcBid',

   'bid': {

 'microAmount': str(bid_modifier)

   },

   }]
}
}
}

On Monday, May 2, 2016 at 10:12:54 AM UTC-5, Kevin Weitzner wrote:
>
> Hi Anup,
>
> Is there a way to obtain criteria Id for actual product IDs for items?  Or 
> is there an easy way to obtain criteria id?  I created a 
> Product_Partition_report for a different adgroup since my actual test one 
> was not showing up (not live campaign).
>
> I got the CriterionId and ran it and got this error:
> suds.WebFault: Server raised fault: '[RequiredError.REQUIRED @ 
> operations[0].operand.criterion.partitionType]'
>
> I picked a simple one with no underlying partitions -
> http://i.imgur.com/ABqO23Y.png
>
> I also tried one with subdivsions and got the same error.  Any ideas? 
>  Once I have this working I will try to expand it so that I can explode our 
> ProductIds from what Josh stated earlier.. I'm not sure why this is so 
> difficult for me.
> --
>
>
>
> On Monday, May 2, 2016 at 9:35:37 AM UTC-5, Anup Pathak wrote:
>>
>> Hi Kevin,
>>
>>
>> You have to take Criteria id from PRODUCT_PARTITION_REPORT and use that 
>> Criteria id,
>>  you are using wrong criteria id
>>
>>
>> let me know if you need more help in this!
>>
>>
>> Thank you!
>> Anup Pathak
>>
>> On Monday, 2 May 2016 19:26:32 UTC+5:30, Kevin Weitzner wrote:
>>>
>>> Hi Anup,
>>>
>>> I tried your operations and still receive an Unmarshalling Error for my 
>>> input string (my criterion ID was a product ID.)  So I changed the product 
>>> groups as such: "All products > lighting, rugs, outdoor, Everything else in 
>>> 'All products'
>>>
>>> Code is as such:
>>>
>>>
>>> ad_group_id = '263'
>>> criterion_id = 'lighting'
>>>
>>> def main(client):
>>> adgroup_criterion_service = 
>>> client.GetService('AdGroupCriterionService', version='v201603')
>>>
>>>
>>> bid_modifier = '1.5'
>>> operation = {
>>> 'xsi_type':'AdGroupCriterionOperation',
>>> 'operator': 'ADD',
>>>
>>> 'operand': {
>>> 'xsi_type': 
>>> 'BiddableAdGroupCriterion',
>>> 'adGroupId': ad_group_id,
>>> 'criterion': {
>>> 'xsi_type': 
>>> 'ProductPartition',
>>> 'id': criterion_id
>>> },
>>> 'biddingStrategyConfiguration': {
>>> 
>>>  'bids': [{
>>> 
>>>'xsi_type': 'CpcBid',
>>> 
>>>'bid': {
>>> 
>>>  'microAmount': str(bid_modifier)
>>> 
>>>},
>>> 
>>>}]
>>> }
>>> }
>>> }
>>>
>>>

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
I modified the code trying to add the partitionType but got this error(edit 
in bold):

suds.WebFault: Server raised fault: 
'[AdGroupCriterionError.PRODUCT_PARTITION_ADD_MAY_ONLY_USE_TEMP_ID @ 
operations[0].operand.criterion, 
AdGroupCriterionError.PRODUCT_PARTITION_ALREADY_EXISTS @ 
operations[0].operand.criterion]'
operation = {
'xsi_type':'AdGroupCriterionOperation',
'operator': 'ADD',

'operand': {
'xsi_type': 'BiddableAdGroupCriterion',
'adGroupId': ad_group_id,
'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id,
   * 'partitionType':'UNIT'*
},
'biddingStrategyConfiguration': {

 'bids': [{

   'xsi_type': 'CpcBid',

   'bid': {

 'microAmount': str(bid_modifier)

   },

   }]
}
}
}


On Monday, May 2, 2016 at 10:12:54 AM UTC-5, Kevin Weitzner wrote:
>
> Hi Anup,
>
> Is there a way to obtain criteria Id for actual product IDs for items?  Or 
> is there an easy way to obtain criteria id?  I created a 
> Product_Partition_report for a different adgroup since my actual test one 
> was not showing up (not live campaign).
>
> I got the CriterionId and ran it and got this error:
> suds.WebFault: Server raised fault: '[RequiredError.REQUIRED @ 
> operations[0].operand.criterion.partitionType]'
>
> I picked a simple one with no underlying partitions -
> http://i.imgur.com/ABqO23Y.png
>
> I also tried one with subdivsions and got the same error.  Any ideas? 
>  Once I have this working I will try to expand it so that I can explode our 
> ProductIds from what Josh stated earlier.. I'm not sure why this is so 
> difficult for me.
> --
>
>
>
> On Monday, May 2, 2016 at 9:35:37 AM UTC-5, Anup Pathak wrote:
>>
>> Hi Kevin,
>>
>>
>> You have to take Criteria id from PRODUCT_PARTITION_REPORT and use that 
>> Criteria id,
>>  you are using wrong criteria id
>>
>>
>> let me know if you need more help in this!
>>
>>
>> Thank you!
>> Anup Pathak
>>
>> On Monday, 2 May 2016 19:26:32 UTC+5:30, Kevin Weitzner wrote:
>>>
>>> Hi Anup,
>>>
>>> I tried your operations and still receive an Unmarshalling Error for my 
>>> input string (my criterion ID was a product ID.)  So I changed the product 
>>> groups as such: "All products > lighting, rugs, outdoor, Everything else in 
>>> 'All products'
>>>
>>> Code is as such:
>>>
>>>
>>> ad_group_id = '263'
>>> criterion_id = 'lighting'
>>>
>>> def main(client):
>>> adgroup_criterion_service = 
>>> client.GetService('AdGroupCriterionService', version='v201603')
>>>
>>>
>>> bid_modifier = '1.5'
>>> operation = {
>>> 'xsi_type':'AdGroupCriterionOperation',
>>> 'operator': 'ADD',
>>>
>>> 'operand': {
>>> 'xsi_type': 
>>> 'BiddableAdGroupCriterion',
>>> 'adGroupId': ad_group_id,
>>> 'criterion': {
>>> 'xsi_type': 
>>> 'ProductPartition',
>>> 'id': criterion_id
>>> },
>>> 'biddingStrategyConfiguration': {
>>> 
>>>  'bids': [{
>>> 
>>>'xsi_type': 'CpcBid',
>>> 
>>>'bid': {
>>> 
>>>  'microAmount': str(bid_modifier)
>>> 
>>>},
>>> 
>>>}]
>>> }
>>> }
>>> }
>>>
>>>
>>>
>>>
>>>
>>> result = 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Hi Anup,

Is there a way to obtain criteria Id for actual product IDs for items?  Or 
is there an easy way to obtain criteria id?  I created a 
Product_Partition_report for a different adgroup since my actual test one 
was not showing up (not live campaign).

I got the CriterionId and ran it and got this error:
suds.WebFault: Server raised fault: '[RequiredError.REQUIRED @ 
operations[0].operand.criterion.partitionType]'

I picked a simple one with no underlying partitions -
http://i.imgur.com/ABqO23Y.png

I also tried one with subdivsions and got the same error.  Any ideas?  Once 
I have this working I will try to expand it so that I can explode our 
ProductIds from what Josh stated earlier.. I'm not sure why this is so 
difficult for me.
--



On Monday, May 2, 2016 at 9:35:37 AM UTC-5, Anup Pathak wrote:
>
> Hi Kevin,
>
>
> You have to take Criteria id from PRODUCT_PARTITION_REPORT and use that 
> Criteria id,
>  you are using wrong criteria id
>
>
> let me know if you need more help in this!
>
>
> Thank you!
> Anup Pathak
>
> On Monday, 2 May 2016 19:26:32 UTC+5:30, Kevin Weitzner wrote:
>>
>> Hi Anup,
>>
>> I tried your operations and still receive an Unmarshalling Error for my 
>> input string (my criterion ID was a product ID.)  So I changed the product 
>> groups as such: "All products > lighting, rugs, outdoor, Everything else in 
>> 'All products'
>>
>> Code is as such:
>>
>>
>> ad_group_id = '263'
>> criterion_id = 'lighting'
>>
>> def main(client):
>> adgroup_criterion_service = 
>> client.GetService('AdGroupCriterionService', version='v201603')
>>
>>
>> bid_modifier = '1.5'
>> operation = {
>> 'xsi_type':'AdGroupCriterionOperation',
>> 'operator': 'ADD',
>>
>> 'operand': {
>> 'xsi_type': 
>> 'BiddableAdGroupCriterion',
>> 'adGroupId': ad_group_id,
>> 'criterion': {
>> 'xsi_type': 
>> 'ProductPartition',
>> 'id': criterion_id
>> },
>> 'biddingStrategyConfiguration': {
>> 
>>  'bids': [{
>>   
>>  'xsi_type': 'CpcBid',
>>   
>>  'bid': {
>>   
>>'microAmount': str(bid_modifier)
>>   
>>  },
>>   
>>  }]
>> }
>> }
>> }
>>
>>
>>
>>
>>
>> result = adgroup_criterion_service.mutate(operation)
>>
>>
>>
>>
>> if __name__ == '__main__':
>>   adwords_client = 
>> adwords.AdWordsClient.LoadFromStorage('**.yaml')
>>   main(adwords_client)
>> ---
>> Image example
>> http://i.imgur.com/p5KhfiG.png
>>
>>
>> I would love to have this work for actual product IDs -- I want to get 
>> this working before I attempt to add the ProductOffer -- as I think 
>> unmarshalling error means that the schema is incorrect..ideally I can 
>> explode all product offer IDs and just set price for those themselves. 
>> exact error: suds.WebFault: Server raised fault: 'Unmarshalling Error: 
>> For input string: "lighting" '
>>
>>
>>
>> On Friday, April 29, 2016 at 7:53:56 PM UTC-5, Anup Pathak wrote:
>>>
>>>
>>>
>>> Hi,
>>> working code for setting cpc bids for Shopping product partitions, I 
>>> hope this will help you.
>>>
>>> operation = {
>>> 'xsi_type':'AdGroupCriterionOperation',
>>> 'operator': 'ADD',
>>> 'operand': {
>>> 'xsi_type': 
>>> 'BiddableAdGroupCriterion',
>>> 'adGroupId': ad_group_id,
>>> 'criterion': {
>>> 'xsi_type': 
>>> 'ProductPartition',
>>> 'id': criterion_id
>>> },
>>> 'biddingStrategyConfiguration': {
>>>  
>>> 'bids': [{
>>> 
>>>
>>> 'xsi_type': 'CpcBid',
>>> 
>>>
>>> 'bid': {
>>>

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Hi Josh,

This did not work :(  I get this error:
suds.WebFault: Server raised fault: 'Unmarshalling Error: cvc-elt.4.3: Type 
'ns0:BiddableAdGroupCriterion' is not validly derived from the type 
definition, 'AdGroupCriterionOperation', of element 'ns0:operations'. '


On Monday, May 2, 2016 at 9:34:27 AM UTC-5, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> I think the problem is in the line highlighted below.
>
> adgroup_criterion['adGroupId'] = adgroup_id
> adgroup_criterion['criterion'] = unit
>
> CreateAddOperation(adgroup_criterion)
> result = adgroup_criterion_service.mutate(adgroup_criterion_service)
>
> Instead of passing *adgroup_criterion_service* to *mutate*, please try 
> passing an array containing the operations (*adgroup_criterion* in your 
> code).
>
> Thanks,
> Josh, AdWords API Team
>
> On Monday, May 2, 2016 at 10:29:53 AM UTC-4, Kevin Weitzner wrote:
>>
>> Hi Josh,
>>
>> I understand the requirements, however I am having a difficult time 
>> translating this to appropriate Python code which does not result in an 
>> unmarshalling error. I have found the Python version of the code you're 
>> referencing --
>>
>> https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201603/shopping/add_product_partition_tree.py
>>
>> I tried to take this code and add modifications but am receiving this 
>> error:
>> suds.WebFault: Server raised fault: 'Unmarshalling Error: 
>> cvc-complex-type.2.3: Element 'ns0:operations' cannot have character 
>> [children], because the type's content type is element-only. '
>> [note: this style of formatting the code makes it very difficult for me 
>> to actually follow how to build it in the style that Anup has]
>>
>> ---
>>
>> ad_group_id = ''
>> criterion_id = '2523931-rou-6'
>>
>> operations = []
>>
>> #report_downloader = client.GetReportDownloader(version='v201603')
>> def main(client, parent=None, value=None):
>> adgroup_id = '**'
>> adgroup_criterion_service = 
>> client.GetService('AdGroupCriterionService', version='v201603')
>> bid_amount = '1500'
>>
>>
>> unit = {
>> 'xsi_type': 'ProductPartition',
>> 'partitionType': 'UNIT'
>> }
>>
>> # The root node has neither a parent nor a value.
>> #if parent is not None:
>> #  unit['parentCriterionId'] = parent['id']
>> #  unit['caseValue'] = value
>> unit['caseValue'] = '2434807-rec-7x10'
>> if bid_amount is not None and bid_amount > 0:
>>   bidding_strategy_configuration = {
>>   'bids': [{
>>   'xsi_type': 'CpcBid',
>>   'bid': {
>>   'xsi_type': 'Money',
>>   'microAmount': str(bid_amount)
>>   }
>>   }]
>>   }
>>
>>   adgroup_criterion = {
>>   'xsi_type': 'BiddableAdGroupCriterion',
>>   'biddingStrategyConfiguration': bidding_strategy_configuration
>>   }
>> else:
>>   adgroup_criterion = {
>>   'xsi_type': 'NegativeAdGroupCriterion'
>>   }
>>
>> adgroup_criterion['adGroupId'] = adgroup_id
>> adgroup_criterion['criterion'] = unit
>>
>> CreateAddOperation(adgroup_criterion)
>> result = adgroup_criterion_service.mutate(adgroup_criterion_service)
>> return unit
>>
>> def CreateAddOperation(criterion):
>> """Creates an AdGroupCriterionOperation for the given criterion.
>> Args:
>>   criterion: The criterion we want to add.
>> """
>> operation = {
>> 'operator': 'ADD',
>> 'operand': criterion
>> }
>>
>> operations.append(operation)
>>
>>
>>
>>
>>
>> if __name__ == '__main__':
>>   adwords_client = adwords.AdWordsClient.LoadFromStorage('.yaml')
>>   main(adwords_client)
>>
>> ---
>>
>> I do not see where to modify the biddableadgroup criterion to the 
>> productpartition type -- this code is much more difficult for me to follow 
>> along with :(.
>>
>>
>>
>> On Friday, April 29, 2016 at 7:28:05 PM UTC-5, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> It looks like you're missing the intermediate *ProductPartition* object. 
>>> You'll want to create one of those with *UNIT* partition type and set 
>>> its *caseValue* to the *ProductOfferId*. The 
>>> *BiddableAdGroupCriterion.criterion* should point to that 
>>> *ProductPartition* object instead of directly to the *ProductOfferId*.
>>>
>>> I realize this can be a bit confusing. :) I'd definitely recommend 
>>> looking at the createUnit function I mentioned earlier 
>>> ,
>>>  
>>> as that handles most of this for you.
>>>
>>> Cheers,
>>> Josh, AdWords API Team
>>>
>>> On Friday, April 29, 2016 at 5:39:46 PM UTC-4, Kevin Weitzner wrote:

 Hi -- I think I am getting closer...


 ad_group_id = '2163'
 criterion_id = '2523931-rou-6'

 Function now looks 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Anup Pathak
Hi Kevin,


You have to take Criteria id from PRODUCT_PARTITION_REPORT and use that 
Criteria id,
 you are using wrong criteria id


let me know if you need more help in this!


Thank you!
Anup Pathak

On Monday, 2 May 2016 19:26:32 UTC+5:30, Kevin Weitzner wrote:
>
> Hi Anup,
>
> I tried your operations and still receive an Unmarshalling Error for my 
> input string (my criterion ID was a product ID.)  So I changed the product 
> groups as such: "All products > lighting, rugs, outdoor, Everything else in 
> 'All products'
>
> Code is as such:
>
>
> ad_group_id = '263'
> criterion_id = 'lighting'
>
> def main(client):
> adgroup_criterion_service = 
> client.GetService('AdGroupCriterionService', version='v201603')
>
>
> bid_modifier = '1.5'
> operation = {
> 'xsi_type':'AdGroupCriterionOperation',
> 'operator': 'ADD',
>
> 'operand': {
> 'xsi_type': 'BiddableAdGroupCriterion',
> 'adGroupId': ad_group_id,
> 'criterion': {
> 'xsi_type': 
> 'ProductPartition',
> 'id': criterion_id
> },
> 'biddingStrategyConfiguration': {
> 
>  'bids': [{
>   
>  'xsi_type': 'CpcBid',
>   
>  'bid': {
>   
>'microAmount': str(bid_modifier)
>   
>  },
>   
>  }]
> }
> }
> }
>
>
>
>
>
> result = adgroup_criterion_service.mutate(operation)
>
>
>
>
> if __name__ == '__main__':
>   adwords_client = 
> adwords.AdWordsClient.LoadFromStorage('**.yaml')
>   main(adwords_client)
> ---
> Image example
> http://i.imgur.com/p5KhfiG.png
>
>
> I would love to have this work for actual product IDs -- I want to get 
> this working before I attempt to add the ProductOffer -- as I think 
> unmarshalling error means that the schema is incorrect..ideally I can 
> explode all product offer IDs and just set price for those themselves. 
> exact error: suds.WebFault: Server raised fault: 'Unmarshalling Error: For 
> input string: "lighting" '
>
>
>
> On Friday, April 29, 2016 at 7:53:56 PM UTC-5, Anup Pathak wrote:
>>
>>
>>
>> Hi,
>> working code for setting cpc bids for Shopping product partitions, I hope 
>> this will help you.
>>
>> operation = {
>> 'xsi_type':'AdGroupCriterionOperation',
>> 'operator': 'ADD',
>> 'operand': {
>> 'xsi_type': 
>> 'BiddableAdGroupCriterion',
>> 'adGroupId': ad_group_id,
>> 'criterion': {
>> 'xsi_type': 
>> 'ProductPartition',
>> 'id': criterion_id
>> },
>> 'biddingStrategyConfiguration': {
>>  
>> 'bids': [{
>>  
>>   
>> 'xsi_type': 'CpcBid',
>>  
>>   
>> 'bid': {
>>  
>> 
>> 'microAmount': str(bid_modifier)
>>  
>>   
>> },
>>  
>>   
>> }]
>> }
>> }
>> }
>>
>> Let me know if you need more help in this!
>>
>> NOTE : your shopping product partition structure should be proper
>>
>> Thank You!
>> Anup Pathak
>>
>> On Saturday, 30 April 2016 05:58:05 UTC+5:30, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> It looks like you're missing the intermediate *ProductPartition* object. 
>>> You'll want to create one of those with *UNIT* partition type and set 
>>> its *caseValue* to the *ProductOfferId*. The 
>>> *BiddableAdGroupCriterion.criterion* should point to that 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread 'Josh Radcliff (AdWords API Team)' via AdWords API Forum
Hi,

I think the problem is in the line highlighted below.

adgroup_criterion['adGroupId'] = adgroup_id
adgroup_criterion['criterion'] = unit

CreateAddOperation(adgroup_criterion)
result = adgroup_criterion_service.mutate(adgroup_criterion_service)

Instead of passing *adgroup_criterion_service* to *mutate*, please try 
passing an array containing the operations (*adgroup_criterion* in your 
code).

Thanks,
Josh, AdWords API Team

On Monday, May 2, 2016 at 10:29:53 AM UTC-4, Kevin Weitzner wrote:
>
> Hi Josh,
>
> I understand the requirements, however I am having a difficult time 
> translating this to appropriate Python code which does not result in an 
> unmarshalling error. I have found the Python version of the code you're 
> referencing --
>
> https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201603/shopping/add_product_partition_tree.py
>
> I tried to take this code and add modifications but am receiving this 
> error:
> suds.WebFault: Server raised fault: 'Unmarshalling Error: 
> cvc-complex-type.2.3: Element 'ns0:operations' cannot have character 
> [children], because the type's content type is element-only. '
> [note: this style of formatting the code makes it very difficult for me to 
> actually follow how to build it in the style that Anup has]
>
> ---
>
> ad_group_id = ''
> criterion_id = '2523931-rou-6'
>
> operations = []
>
> #report_downloader = client.GetReportDownloader(version='v201603')
> def main(client, parent=None, value=None):
> adgroup_id = '**'
> adgroup_criterion_service = 
> client.GetService('AdGroupCriterionService', version='v201603')
> bid_amount = '1500'
>
>
> unit = {
> 'xsi_type': 'ProductPartition',
> 'partitionType': 'UNIT'
> }
>
> # The root node has neither a parent nor a value.
> #if parent is not None:
> #  unit['parentCriterionId'] = parent['id']
> #  unit['caseValue'] = value
> unit['caseValue'] = '2434807-rec-7x10'
> if bid_amount is not None and bid_amount > 0:
>   bidding_strategy_configuration = {
>   'bids': [{
>   'xsi_type': 'CpcBid',
>   'bid': {
>   'xsi_type': 'Money',
>   'microAmount': str(bid_amount)
>   }
>   }]
>   }
>
>   adgroup_criterion = {
>   'xsi_type': 'BiddableAdGroupCriterion',
>   'biddingStrategyConfiguration': bidding_strategy_configuration
>   }
> else:
>   adgroup_criterion = {
>   'xsi_type': 'NegativeAdGroupCriterion'
>   }
>
> adgroup_criterion['adGroupId'] = adgroup_id
> adgroup_criterion['criterion'] = unit
>
> CreateAddOperation(adgroup_criterion)
> result = adgroup_criterion_service.mutate(adgroup_criterion_service)
> return unit
>
> def CreateAddOperation(criterion):
> """Creates an AdGroupCriterionOperation for the given criterion.
> Args:
>   criterion: The criterion we want to add.
> """
> operation = {
> 'operator': 'ADD',
> 'operand': criterion
> }
>
> operations.append(operation)
>
>
>
>
>
> if __name__ == '__main__':
>   adwords_client = adwords.AdWordsClient.LoadFromStorage('.yaml')
>   main(adwords_client)
>
> ---
>
> I do not see where to modify the biddableadgroup criterion to the 
> productpartition type -- this code is much more difficult for me to follow 
> along with :(.
>
>
>
> On Friday, April 29, 2016 at 7:28:05 PM UTC-5, Josh Radcliff (AdWords API 
> Team) wrote:
>>
>> Hi,
>>
>> It looks like you're missing the intermediate *ProductPartition* object. 
>> You'll want to create one of those with *UNIT* partition type and set 
>> its *caseValue* to the *ProductOfferId*. The 
>> *BiddableAdGroupCriterion.criterion* should point to that 
>> *ProductPartition* object instead of directly to the *ProductOfferId*.
>>
>> I realize this can be a bit confusing. :) I'd definitely recommend 
>> looking at the createUnit function I mentioned earlier 
>> ,
>>  
>> as that handles most of this for you.
>>
>> Cheers,
>> Josh, AdWords API Team
>>
>> On Friday, April 29, 2016 at 5:39:46 PM UTC-4, Kevin Weitzner wrote:
>>>
>>> Hi -- I think I am getting closer...
>>>
>>>
>>> ad_group_id = '2163'
>>> criterion_id = '2523931-rou-6'
>>>
>>> Function now looks like this -
>>> def main(client):
>>> adgroup_criterion_service = 
>>> client.GetService('AdGroupCriterionService', version='v201603')
>>>
>>>
>>> bid_modifier = '1.5'
>>> operations =  [{
>>>   'xsi_type':'AdGroupCriterionOperation',
>>>   'operator': 'SET',
>>>   'operand': {
>>>   'xsi_type': 
>>> 'BiddableAdGroupCriterion',
>>>   'adGroupId': 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Hi Josh,

I understand the requirements, however I am having a difficult time 
translating this to appropriate Python code which does not result in an 
unmarshalling error. I have found the Python version of the code you're 
referencing --
https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/v201603/shopping/add_product_partition_tree.py

I tried to take this code and add modifications but am receiving this error:
suds.WebFault: Server raised fault: 'Unmarshalling Error: 
cvc-complex-type.2.3: Element 'ns0:operations' cannot have character 
[children], because the type's content type is element-only. '
[note: this style of formatting the code makes it very difficult for me to 
actually follow how to build it in the style that Anup has]

---

ad_group_id = ''
criterion_id = '2523931-rou-6'

operations = []

#report_downloader = client.GetReportDownloader(version='v201603')
def main(client, parent=None, value=None):
adgroup_id = '**'
adgroup_criterion_service = 
client.GetService('AdGroupCriterionService', version='v201603')
bid_amount = '1500'


unit = {
'xsi_type': 'ProductPartition',
'partitionType': 'UNIT'
}

# The root node has neither a parent nor a value.
#if parent is not None:
#  unit['parentCriterionId'] = parent['id']
#  unit['caseValue'] = value
unit['caseValue'] = '2434807-rec-7x10'
if bid_amount is not None and bid_amount > 0:
  bidding_strategy_configuration = {
  'bids': [{
  'xsi_type': 'CpcBid',
  'bid': {
  'xsi_type': 'Money',
  'microAmount': str(bid_amount)
  }
  }]
  }

  adgroup_criterion = {
  'xsi_type': 'BiddableAdGroupCriterion',
  'biddingStrategyConfiguration': bidding_strategy_configuration
  }
else:
  adgroup_criterion = {
  'xsi_type': 'NegativeAdGroupCriterion'
  }

adgroup_criterion['adGroupId'] = adgroup_id
adgroup_criterion['criterion'] = unit

CreateAddOperation(adgroup_criterion)
result = adgroup_criterion_service.mutate(adgroup_criterion_service)
return unit

def CreateAddOperation(criterion):
"""Creates an AdGroupCriterionOperation for the given criterion.
Args:
  criterion: The criterion we want to add.
"""
operation = {
'operator': 'ADD',
'operand': criterion
}

operations.append(operation)





if __name__ == '__main__':
  adwords_client = adwords.AdWordsClient.LoadFromStorage('.yaml')
  main(adwords_client)

---

I do not see where to modify the biddableadgroup criterion to the 
productpartition type -- this code is much more difficult for me to follow 
along with :(.



On Friday, April 29, 2016 at 7:28:05 PM UTC-5, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> It looks like you're missing the intermediate *ProductPartition* object. 
> You'll want to create one of those with *UNIT* partition type and set its 
> *caseValue* to the *ProductOfferId*. The 
> *BiddableAdGroupCriterion.criterion* should point to that 
> *ProductPartition* object instead of directly to the *ProductOfferId*.
>
> I realize this can be a bit confusing. :) I'd definitely recommend looking 
> at the createUnit function I mentioned earlier 
> ,
>  
> as that handles most of this for you.
>
> Cheers,
> Josh, AdWords API Team
>
> On Friday, April 29, 2016 at 5:39:46 PM UTC-4, Kevin Weitzner wrote:
>>
>> Hi -- I think I am getting closer...
>>
>>
>> ad_group_id = '2163'
>> criterion_id = '2523931-rou-6'
>>
>> Function now looks like this -
>> def main(client):
>> adgroup_criterion_service = 
>> client.GetService('AdGroupCriterionService', version='v201603')
>>
>>
>> bid_modifier = '1.5'
>> operations =  [{
>>   'xsi_type':'AdGroupCriterionOperation',
>>   'operator': 'SET',
>>   'operand': {
>>   'xsi_type': 
>> 'BiddableAdGroupCriterion',
>>   'adGroupId': ad_group_id,
>>   'criterion': {
>> 'xsi_type': 
>> 'ProductOfferId',
>> 'value': criterion_id
>> },
>>'bidModifier': bid_modifier
>>
>> }
>>   }]
>> result = adgroup_criterion_service.mutate(operations)
>> --
>>
>> I want to set an absolute CPC bid (variable name bid_modifier from 
>> earlier, $1.5) on an individual product ID -
>> I get this error:
>> suds.WebFault: Server raised fault: 'Unmarshalling Error: cvc-elt.4.3: 
>> Type 'ns0:ProductOfferId' 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-05-02 Thread Kevin Weitzner
Hi Anup,

I tried your operations and still receive an Unmarshalling Error for my 
input string (my criterion ID was a product ID.)  So I changed the product 
groups as such: "All products > lighting, rugs, outdoor, Everything else in 
'All products'

Code is as such:


ad_group_id = '263'
criterion_id = 'lighting'

def main(client):
adgroup_criterion_service = 
client.GetService('AdGroupCriterionService', version='v201603')


bid_modifier = '1.5'
operation = {
'xsi_type':'AdGroupCriterionOperation',
'operator': 'ADD',

'operand': {
'xsi_type': 'BiddableAdGroupCriterion',
'adGroupId': ad_group_id,
'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id
},
'biddingStrategyConfiguration': {

 'bids': [{

   'xsi_type': 'CpcBid',

   'bid': {

 'microAmount': str(bid_modifier)

   },

   }]
}
}
}





result = adgroup_criterion_service.mutate(operation)




if __name__ == '__main__':
  adwords_client = 
adwords.AdWordsClient.LoadFromStorage('**.yaml')
  main(adwords_client)
---
Image example
http://i.imgur.com/p5KhfiG.png


I would love to have this work for actual product IDs -- I want to get this 
working before I attempt to add the ProductOffer -- as I think 
unmarshalling error means that the schema is incorrect..ideally I can 
explode all product offer IDs and just set price for those themselves. 
exact error: suds.WebFault: Server raised fault: 'Unmarshalling Error: For 
input string: "lighting" '



On Friday, April 29, 2016 at 7:53:56 PM UTC-5, Anup Pathak wrote:
>
>
>
> Hi,
> working code for setting cpc bids for Shopping product partitions, I hope 
> this will help you.
>
> operation = {
> 'xsi_type':'AdGroupCriterionOperation',
> 'operator': 'ADD',
> 'operand': {
> 'xsi_type': 'BiddableAdGroupCriterion',
> 'adGroupId': ad_group_id,
> 'criterion': {
> 'xsi_type': 
> 'ProductPartition',
> 'id': criterion_id
> },
> 'biddingStrategyConfiguration': {
>  
> 'bids': [{
>   
>  
> 'xsi_type': 'CpcBid',
>   
>  
> 'bid': {
>   
>
> 'microAmount': str(bid_modifier)
>   
>  
> },
>   
>  
> }]
> }
> }
> }
>
> Let me know if you need more help in this!
>
> NOTE : your shopping product partition structure should be proper
>
> Thank You!
> Anup Pathak
>
> On Saturday, 30 April 2016 05:58:05 UTC+5:30, Josh Radcliff (AdWords API 
> Team) wrote:
>>
>> Hi,
>>
>> It looks like you're missing the intermediate *ProductPartition* object. 
>> You'll want to create one of those with *UNIT* partition type and set 
>> its *caseValue* to the *ProductOfferId*. The 
>> *BiddableAdGroupCriterion.criterion* should point to that 
>> *ProductPartition* object instead of directly to the *ProductOfferId*.
>>
>> I realize this can be a bit confusing. :) I'd definitely recommend 
>> looking at the createUnit function I mentioned earlier 
>> ,
>>  
>> as that handles most of this for you.
>>
>> Cheers,
>> Josh, AdWords API Team
>>
>> On Friday, 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-04-29 Thread Anup Pathak


Hi,
working code for setting cpc bids for Shopping product partitions, I hope 
this will help you.

operation = {
'xsi_type':'AdGroupCriterionOperation',
'operator': 'ADD',
'operand': {
'xsi_type': 'BiddableAdGroupCriterion',
'adGroupId': ad_group_id,
'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id
},
'biddingStrategyConfiguration': {
 
'bids': [{
   
'xsi_type': 'CpcBid',
   
'bid': {

 
'microAmount': str(bid_modifier)

   
},
   
}]
}
}
}

Let me know if you need more help in this!

NOTE : your shopping product partition structure should be proper

Thank You!
Anup Pathak

On Saturday, 30 April 2016 05:58:05 UTC+5:30, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> It looks like you're missing the intermediate *ProductPartition* object. 
> You'll want to create one of those with *UNIT* partition type and set its 
> *caseValue* to the *ProductOfferId*. The 
> *BiddableAdGroupCriterion.criterion* should point to that 
> *ProductPartition* object instead of directly to the *ProductOfferId*.
>
> I realize this can be a bit confusing. :) I'd definitely recommend looking 
> at the createUnit function I mentioned earlier 
> ,
>  
> as that handles most of this for you.
>
> Cheers,
> Josh, AdWords API Team
>
> On Friday, April 29, 2016 at 5:39:46 PM UTC-4, Kevin Weitzner wrote:
>>
>> Hi -- I think I am getting closer...
>>
>>
>> ad_group_id = '2163'
>> criterion_id = '2523931-rou-6'
>>
>> Function now looks like this -
>> def main(client):
>> adgroup_criterion_service = 
>> client.GetService('AdGroupCriterionService', version='v201603')
>>
>>
>> bid_modifier = '1.5'
>> operations =  [{
>>   'xsi_type':'AdGroupCriterionOperation',
>>   'operator': 'SET',
>>   'operand': {
>>   'xsi_type': 
>> 'BiddableAdGroupCriterion',
>>   'adGroupId': ad_group_id,
>>   'criterion': {
>> 'xsi_type': 
>> 'ProductOfferId',
>> 'value': criterion_id
>> },
>>'bidModifier': bid_modifier
>>
>> }
>>   }]
>> result = adgroup_criterion_service.mutate(operations)
>> --
>>
>> I want to set an absolute CPC bid (variable name bid_modifier from 
>> earlier, $1.5) on an individual product ID -
>> I get this error:
>> suds.WebFault: Server raised fault: 'Unmarshalling Error: cvc-elt.4.3: 
>> Type 'ns0:ProductOfferId' is not validly derived from the type definition, 
>> 'Criterion', of element 'ns0:criterion'. '
>> -
>>
>> Any ideas on what I have done wrong here
>>
>>
>>
>>
>> On Friday, April 29, 2016 at 4:07:34 PM UTC-5, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi Kevin,
>>>
>>> You can set bids at the product/item ID level by creating 
>>> BiddableAdGroupCriterion 
>>> 
>>>  
>>> objects with:
>>>
>>>- criterion 
>>>
>>> 
>>>  = 
>>>a ProductPartition 
>>>
>>> 
>>> with:
>>>- caseValue 
>>>   
>>> 
>>>  = 
>>>   a ProductOfferId 
>>>   
>>> 
>>>with:
>>>   - value 
>>>  

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-04-29 Thread 'Josh Radcliff (AdWords API Team)' via AdWords API Forum
Hi,

It looks like you're missing the intermediate *ProductPartition* object. 
You'll want to create one of those with *UNIT* partition type and set its 
*caseValue* to the *ProductOfferId*. The 
*BiddableAdGroupCriterion.criterion* should point to that *ProductPartition* 
object 
instead of directly to the *ProductOfferId*.

I realize this can be a bit confusing. :) I'd definitely recommend looking 
at the createUnit function I mentioned earlier 
,
 
as that handles most of this for you.

Cheers,
Josh, AdWords API Team

On Friday, April 29, 2016 at 5:39:46 PM UTC-4, Kevin Weitzner wrote:
>
> Hi -- I think I am getting closer...
>
>
> ad_group_id = '2163'
> criterion_id = '2523931-rou-6'
>
> Function now looks like this -
> def main(client):
> adgroup_criterion_service = 
> client.GetService('AdGroupCriterionService', version='v201603')
>
>
> bid_modifier = '1.5'
> operations =  [{
>   'xsi_type':'AdGroupCriterionOperation',
>   'operator': 'SET',
>   'operand': {
>   'xsi_type': 
> 'BiddableAdGroupCriterion',
>   'adGroupId': ad_group_id,
>   'criterion': {
> 'xsi_type': 
> 'ProductOfferId',
> 'value': criterion_id
> },
>'bidModifier': bid_modifier
>
> }
>   }]
> result = adgroup_criterion_service.mutate(operations)
> --
>
> I want to set an absolute CPC bid (variable name bid_modifier from 
> earlier, $1.5) on an individual product ID -
> I get this error:
> suds.WebFault: Server raised fault: 'Unmarshalling Error: cvc-elt.4.3: 
> Type 'ns0:ProductOfferId' is not validly derived from the type definition, 
> 'Criterion', of element 'ns0:criterion'. '
> -
>
> Any ideas on what I have done wrong here
>
>
>
>
> On Friday, April 29, 2016 at 4:07:34 PM UTC-5, Josh Radcliff (AdWords API 
> Team) wrote:
>>
>> Hi Kevin,
>>
>> You can set bids at the product/item ID level by creating 
>> BiddableAdGroupCriterion 
>> 
>>  
>> objects with:
>>
>>- criterion 
>>
>> 
>>  = 
>>a ProductPartition 
>>
>> 
>> with:
>>- caseValue 
>>   
>> 
>>  = 
>>   a ProductOfferId 
>>   
>> 
>>with:
>>   - value 
>>  
>> 
>>  set 
>>  to the product ID from Merchant Center
>>  - biddingStrategyConfiguration 
>>
>> 
>>  configured 
>>with your bids
>>
>> Please see the createUnit function in the AddProductPartitionTree.php 
>> example 
>> 
>>  for 
>> details.
>>
>> Cheers,
>> Josh, AdWords API Team
>>
>> On Friday, April 29, 2016 at 4:31:51 PM UTC-4, Kevin Weitzner wrote:
>>>
>>> Hi -- I am not certain how the last step should be executed --I am not 
>>> getting any errors, however CPC for productID is not being set.
>>>
>>> See script below:
>>>
>>> ad_group_id = '**'
>>> criterion_id = '**'
>>>
>>> def main(client):
>>> adgroup_criterion_service = 
>>> client.GetService('AdGroupCriterionService', version='v201603')
>>>
>>> bid_modifier = '15'
>>>
>>> operations =  [{
>>>   'xsi_type':'AdGroupCriterionOperation',
>>>   'operator': 'SET',
>>>   'operand': {
>>>   'xsi_type': 
>>> 'BiddableAdGroupCriterion',
>>>   'adGroupId': ad_group_id,
>>>   'criterion': {
>>> 'xsi_type': 
>>> 'ProductPartition',
>>> 'id': criterion_id
>>>   

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-04-29 Thread Kevin Weitzner
Hi -- I think I am getting closer...


ad_group_id = '2163'
criterion_id = '2523931-rou-6'

Function now looks like this -
def main(client):
adgroup_criterion_service = 
client.GetService('AdGroupCriterionService', version='v201603')


bid_modifier = '1.5'
operations =  [{
  'xsi_type':'AdGroupCriterionOperation',
  'operator': 'SET',
  'operand': {
  'xsi_type': 
'BiddableAdGroupCriterion',
  'adGroupId': ad_group_id,
  'criterion': {
'xsi_type': 
'ProductOfferId',
'value': criterion_id
},
   'bidModifier': bid_modifier

}
  }]
result = adgroup_criterion_service.mutate(operations)
--

I want to set an absolute CPC bid (variable name bid_modifier from earlier, 
$1.5) on an individual product ID -
I get this error:
suds.WebFault: Server raised fault: 'Unmarshalling Error: cvc-elt.4.3: Type 
'ns0:ProductOfferId' is not validly derived from the type definition, 
'Criterion', of element 'ns0:criterion'. '
-

Any ideas on what I have done wrong here




On Friday, April 29, 2016 at 4:07:34 PM UTC-5, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi Kevin,
>
> You can set bids at the product/item ID level by creating 
> BiddableAdGroupCriterion 
> 
>  
> objects with:
>
>- criterion 
>
> 
>  = 
>a ProductPartition 
>
> 
> with:
>- caseValue 
>   
> 
>  = 
>   a ProductOfferId 
>   
> 
>with:
>   - value 
>  
> 
>  set 
>  to the product ID from Merchant Center
>  - biddingStrategyConfiguration 
>
> 
>  configured 
>with your bids
>
> Please see the createUnit function in the AddProductPartitionTree.php 
> example 
> 
>  for 
> details.
>
> Cheers,
> Josh, AdWords API Team
>
> On Friday, April 29, 2016 at 4:31:51 PM UTC-4, Kevin Weitzner wrote:
>>
>> Hi -- I am not certain how the last step should be executed --I am not 
>> getting any errors, however CPC for productID is not being set.
>>
>> See script below:
>>
>> ad_group_id = '**'
>> criterion_id = '**'
>>
>> def main(client):
>> adgroup_criterion_service = 
>> client.GetService('AdGroupCriterionService', version='v201603')
>>
>> bid_modifier = '15'
>>
>> operations =  [{
>>   'xsi_type':'AdGroupCriterionOperation',
>>   'operator': 'SET',
>>   'operand': {
>>   'xsi_type': 
>> 'BiddableAdGroupCriterion',
>>   'adGroupId': ad_group_id,
>>   'criterion': {
>> 'xsi_type': 
>> 'ProductPartition',
>> 'id': criterion_id
>> },
>>'bidModifier':bid_modifier
>>
>> }
>>   }]
>>
>> if __name__ == '__main__':
>>   adwords_client = adwords.AdWordsClient.LoadFromStorage('**.yaml')
>>   main(adwords_client)
>>
>> --
>>
>> I would like to be able to set the CPC of product Ids themselves by 
>> passing the appropriate product ID in the Criterion_ID --- I have thousands 
>> of products that I want to try a strategy on.  I believe the last step in 
>> the explanation is what I am missing here.
>>
>> Thanks,
>> Kevin
>>
>> On Thursday, September 25, 2014 at 12:00:28 PM UTC-5, Josh Radcliff 
>> (AdWords API Team) wrote:
>>>
>>> Hi Steve,
>>>
>>> Just to clarify - by "script" I'm assuming you mean code that executes 
>>> methods in the AdWords API 
>>> 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-04-29 Thread 'Josh Radcliff (AdWords API Team)' via AdWords API Forum
Hi Kevin,

You can set bids at the product/item ID level by creating 
BiddableAdGroupCriterion 

 
objects with:

   - criterion 
   

 = 
   a ProductPartition 
   

with:
   - caseValue 
  

 = 
  a ProductOfferId 
  

   with:
  - value 
 

 set 
 to the product ID from Merchant Center
 - biddingStrategyConfiguration 
   

 configured 
   with your bids
   
Please see the createUnit function in the AddProductPartitionTree.php 
example 

 for 
details.

Cheers,
Josh, AdWords API Team

On Friday, April 29, 2016 at 4:31:51 PM UTC-4, Kevin Weitzner wrote:
>
> Hi -- I am not certain how the last step should be executed --I am not 
> getting any errors, however CPC for productID is not being set.
>
> See script below:
>
> ad_group_id = '**'
> criterion_id = '**'
>
> def main(client):
> adgroup_criterion_service = 
> client.GetService('AdGroupCriterionService', version='v201603')
>
> bid_modifier = '15'
>
> operations =  [{
>   'xsi_type':'AdGroupCriterionOperation',
>   'operator': 'SET',
>   'operand': {
>   'xsi_type': 
> 'BiddableAdGroupCriterion',
>   'adGroupId': ad_group_id,
>   'criterion': {
> 'xsi_type': 
> 'ProductPartition',
> 'id': criterion_id
> },
>'bidModifier':bid_modifier
>
> }
>   }]
>
> if __name__ == '__main__':
>   adwords_client = adwords.AdWordsClient.LoadFromStorage('**.yaml')
>   main(adwords_client)
>
> --
>
> I would like to be able to set the CPC of product Ids themselves by 
> passing the appropriate product ID in the Criterion_ID --- I have thousands 
> of products that I want to try a strategy on.  I believe the last step in 
> the explanation is what I am missing here.
>
> Thanks,
> Kevin
>
> On Thursday, September 25, 2014 at 12:00:28 PM UTC-5, Josh Radcliff 
> (AdWords API Team) wrote:
>>
>> Hi Steve,
>>
>> Just to clarify - by "script" I'm assuming you mean code that executes 
>> methods in the AdWords API 
>> , and not AdWords 
>> Scripts . All management 
>> of product groups in the AdWords API is done via AdGroupCriterionService 
>> .
>>  
>> The Shopping Guide 
>>  contains 
>> a useful introduction to the concepts involved.
>>
>> Once you have your product groups set up, you can modify a given product 
>> group's CPC bid by sending an AdGroupCriterionService.mutate 
>> 
>>  call 
>> containing an AdGroupCriterionOperation 
>> 
>>  where 
>> the *operator* is *SET* and the operand is a BiddableAdGroupCriterion 
>> 
>>  with:
>>
>>- adGroupId 
>>
>> 
>>  set 
>>to the ad group's ID
>>- criterion 
>>
>> 
>>  set 
>>to a ProductPartition 
>>
>> 
>>  with 
>>its id 
>>
>> 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2016-04-29 Thread Kevin Weitzner
Hi -- I am not certain how the last step should be executed --I am not 
getting any errors, however CPC for productID is not being set.

See script below:

ad_group_id = '**'
criterion_id = '**'

def main(client):
adgroup_criterion_service = 
client.GetService('AdGroupCriterionService', version='v201603')

bid_modifier = '15'

operations =  [{
  'xsi_type':'AdGroupCriterionOperation',
  'operator': 'SET',
  'operand': {
  'xsi_type': 
'BiddableAdGroupCriterion',
  'adGroupId': ad_group_id,
  'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id
},
   'bidModifier':bid_modifier

}
  }]

if __name__ == '__main__':
  adwords_client = adwords.AdWordsClient.LoadFromStorage('**.yaml')
  main(adwords_client)

--

I would like to be able to set the CPC of product Ids themselves by passing 
the appropriate product ID in the Criterion_ID --- I have thousands of 
products that I want to try a strategy on.  I believe the last step in the 
explanation is what I am missing here.

Thanks,
Kevin

On Thursday, September 25, 2014 at 12:00:28 PM UTC-5, Josh Radcliff 
(AdWords API Team) wrote:
>
> Hi Steve,
>
> Just to clarify - by "script" I'm assuming you mean code that executes 
> methods in the AdWords API 
> , and not AdWords Scripts 
> . All management of 
> product groups in the AdWords API is done via AdGroupCriterionService 
> .
>  
> The Shopping Guide 
>  contains 
> a useful introduction to the concepts involved.
>
> Once you have your product groups set up, you can modify a given product 
> group's CPC bid by sending an AdGroupCriterionService.mutate 
> 
>  call 
> containing an AdGroupCriterionOperation 
> 
>  where 
> the *operator* is *SET* and the operand is a BiddableAdGroupCriterion 
> 
>  with:
>
>- adGroupId 
>
> 
>  set 
>to the ad group's ID
>- criterion 
>
> 
>  set 
>to a ProductPartition 
>
> 
>  with 
>its id 
>
> 
>  set 
>to the product group's (ProductPartition's) ID you want to update
>- biddingStrategyConfiguration 
>
> 
>  set 
>to a BiddingStrategyConfiguration 
>
> 
>  object 
>with the proper CPC bid configured
>
> To monitor the performance of each product group (ProductPartition), you 
> can use the API's Product Partition Report 
> 
> .
>
> Cheers,
> Josh, AdWords API Team
>
> On Wednesday, September 24, 2014 10:41:29 AM UTC-4, Steve Berg wrote:
>>
>> Hello, 
>>
>> I would like in my 30 Shopping Campaigns 
>> the offer and the management of the CPC from the Product Groups automate. 
>>
>> For example, the CPC should be low in a low CTR 
>> be in good conversion correspondingly higher. 
>>
>> How would a possible script look like? 
>>
>> Best Regards 
>> - Steve -
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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, 

Re: Script - Google Shopping Campaign - Auto CPC Bid

2014-10-17 Thread Anup Pathak
Hello Josh,

Issue resolved  Thank You!




On Wednesday, September 24, 2014 8:11:29 PM UTC+5:30, Steve Berg wrote:

 Hello, 

 I would like in my 30 Shopping Campaigns 
 the offer and the management of the CPC from the Product Groups automate. 
 For example, the CPC should be low in a low CTR 
 be in good conversion correspondingly higher. 

 How would a possible script look like? 

 Best Regards 
 - Steve -


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/2bd408c5-a882-4d4c-9d34-7f0cffd8481c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script - Google Shopping Campaign - Auto CPC Bid

2014-10-16 Thread Anup Pathak
Hi Josh,

i want to change product group cpc, i have created product groups by   
item id

I followed your steps here is code (Python)

 adgroup_criterion_service = 
adwords_client.GetService('AdGroupCriterionService', version='v201406')

 bid_modifier = '1.5' 
operations =  [{
  'xsi_type':'AdGroupCriterionOperation',
  'operator': 'SET',
  'operand': {
  'xsi_type': 
'BiddableAdGroupCriterion',
  'adGroupId': ad_group_id,
  'criterion': {
'xsi_type': 
'ProductPartition',
'id': criterion_id
},
   'bidModifier':bid_modifier

}
  }]
when i am running above code i got Error 
 CriterionError.CANNOT_BID_MODIFY_CRITERION_TYPE @ 
operations[0].operand.bidModifier

can you please help me to solve this errorr


Thank You!
Anup


On Wednesday, September 24, 2014 8:11:29 PM UTC+5:30, Steve Berg wrote:

 Hello, 

 I would like in my 30 Shopping Campaigns 
 the offer and the management of the CPC from the Product Groups automate. 
 For example, the CPC should be low in a low CTR 
 be in good conversion correspondingly higher. 

 How would a possible script look like? 

 Best Regards 
 - Steve -


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f69fe4e6-8856-4b8b-9503-e46852779e9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script - Google Shopping Campaign - Auto CPC Bid

2014-09-25 Thread Josh Radcliff (AdWords API Team)
Hi Steve,

Just to clarify - by script I'm assuming you mean code that executes 
methods in the AdWords API https://developers.google.com/adwords/api/docs/, 
and not AdWords Scripts https://developers.google.com/adwords/scripts/. 
All management of product groups in the AdWords API is done via 
AdGroupCriterionService 
https://developers.google.com/adwords/api/docs/reference/latest/AdGroupCriterionService.
 
The Shopping Guide 
https://developers.google.com/adwords/api/docs/guides/shopping contains a 
useful introduction to the concepts involved.

Once you have your product groups set up, you can modify a given product 
group's CPC bid by sending an AdGroupCriterionService.mutate 
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService#mutate
 call 
containing an AdGroupCriterionOperation 
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.AdGroupCriterionOperation
 where 
the *operator* is *SET* and the operand is a BiddableAdGroupCriterion 
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.BiddableAdGroupCriterion
 with:

   - adGroupId 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.BiddableAdGroupCriterion#adGroupId
 set 
   to the ad group's ID
   - criterion 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.BiddableAdGroupCriterion#criterion
 set 
   to a ProductPartition 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.ProductPartition
 with 
   its id 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.ProductPartition#id
 set 
   to the product group's (ProductPartition's) ID you want to update
   - biddingStrategyConfiguration 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.BiddableAdGroupCriterion#biddingStrategyConfiguration
 set 
   to a BiddingStrategyConfiguration 
   
https://developers.google.com/adwords/api/docs/reference/v201406/AdGroupCriterionService.BiddingStrategyConfiguration
 object 
   with the proper CPC bid configured
   
To monitor the performance of each product group (ProductPartition), you 
can use the API's Product Partition Report 
https://developers.google.com/adwords/api/docs/appendix/reports#product-partition
.

Cheers,
Josh, AdWords API Team

On Wednesday, September 24, 2014 10:41:29 AM UTC-4, Steve Berg wrote:

 Hello, 

 I would like in my 30 Shopping Campaigns 
 the offer and the management of the CPC from the Product Groups automate. 
 For example, the CPC should be low in a low CTR 
 be in good conversion correspondingly higher. 

 How would a possible script look like? 

 Best Regards 
 - Steve -


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e667b801-02df-409b-b2c5-881d1d9b8fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Script - Google Shopping Campaign - Auto CPC Bid

2014-09-24 Thread Steve Berg
Hello, 

I would like in my 30 Shopping Campaigns 
the offer and the management of the CPC from the Product Groups automate. 
For example, the CPC should be low in a low CTR 
be in good conversion correspondingly higher. 

How would a possible script look like? 

Best Regards 
- Steve -

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
--- 
You received this message because you are subscribed to the Google Groups 
AdWords API Forum group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/f77f21b4-6f18-448b-bee2-dc3753806931%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.