Adwords Python lib - TargetingCampaignId not working for Price Extension update

50 views
Skip to first unread message

allan...@maxmilhas.com.br

unread,
Nov 3, 2017, 4:37:51 PM11/3/17
to AdWords API Forum

Guys, I'm trying to update a Price Extension via API to a specific campaign, but, even passing the `TargetingCampaignId`, the API is not linking extension to that campaign, just to the account. I'm using the Google Ads Python Library. I`ve already created an issue on Python Adword SDK Github's repository, but they suggested that the problem maybe is with the API. The response looks ok (see below).

My payload to the `extension_settings.mutate` method is:


[
 
{
   
"operator": "SET",
   
"operand": {
     
"extensionSetting": {
       
"extensions": [
         
{
           
"priceQualifier": "UP_TO",
           
"priceExtensionType": "SERVICES",
           
"language": "pt-BR",
           
"xsi_type": "PriceFeedItem",
           
"scheduling": {
             
"feedItemSchedules": [
               
{
                 
"dayOfWeek": "SUNDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "SATURDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "FRIDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "THURSDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "WEDNESDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "TUESDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
},
               
{
                 
"dayOfWeek": "MONDAY",
                 
"endHour": 23,
                 
"startMinute": "ZERO",
                 
"endMinute": "ZERO",
                 
"startHour": 0
               
}
             
]
           
},
           
"tableRows": [
             
{
               
"description": "Oferta Imperdivel",
               
"xsi_type": "PriceTableRow",
               
"price": {
                 
"money": {
                   
"microAmount": 228000000
                 
},
                 
"currencyCode": "BRL"
               
},
               
"priceUnit": null,
               
"header": "De Rio a Brasedlia",
               
"finalUrls": {
                 
"urls": [
                   
"http://www.maxmilhas.com.br"
                 
]
               
}
             
},
             
{
               
"description": "Oferta Imperdivel",
               
"xsi_type": "PriceTableRow",
               
"price": {
                 
"money": {
                   
"microAmount": 596000000
                 
},
                 
"currencyCode": "BRL"
               
},
               
"priceUnit": null,
               
"header": "De Rio a Fortaleza",
               
"finalUrls": {
                 
"urls": [
                   
"http://www.maxmilhas.com.br"
                 
]
               
}
             
},
             
{
               
"description": "Oferta Imperdivel",
               
"xsi_type": "PriceTableRow",
               
"price": {
                 
"money": {
                   
"microAmount": 388000000
                 
},
                 
"currencyCode": "BRL"
               
},
               
"priceUnit": null,
               
"header": "De Rio a Porto Alegre",
               
"finalUrls": {
                 
"urls": [
                   
"http://www.maxmilhas.com.br"
                 
]
               
}
             
}
           
],
           
"campaignTargeting": {
             
"TargetingCampaignId": "934720050"
           
},
           
"trackingUrlTemplate": ""
         
}
       
]
     
},
     
"extensionType": "PRICE"
   
}
 
}
]


The response that API is (Python object):


(CustomerExtensionSettingReturnValue){
   
ListReturnValue.Type = "CustomerExtensionSettingReturnValue"
   value
[] =
     
(CustomerExtensionSetting){
         extensionType
= "PRICE"
         extensionSetting
=
           
(ExtensionSetting){
               extensions
[] =
                 
(PriceFeedItem){
                     feedId
= 54897150
                     feedItemId
= 22069494937
                     status
= "ENABLED"
                     feedType
= "PRICE"
                     scheduling
=
                       
(FeedItemScheduling){
                           feedItemSchedules
[] =
                             
(FeedItemSchedule){
                                 dayOfWeek
= "MONDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "TUESDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "WEDNESDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "THURSDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "FRIDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "SATURDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                             
(FeedItemSchedule){
                                 dayOfWeek
= "SUNDAY"
                                 startHour
= 0
                                 startMinute
= "ZERO"
                                 endHour
= 23
                                 endMinute
= "ZERO"
                             
},
                       
}
                     campaignTargeting
=
                       
(FeedItemCampaignTargeting){
                           
TargetingCampaignId = 934720050
                       
}
                     
ExtensionFeedItem.Type = "PriceFeedItem"
                     priceExtensionType
= "SERVICES"
                     priceQualifier
= "UP_TO"
                     language
= "pt-br"
                     tableRows
[] =
                       
(PriceTableRow){
                           header
= "De Rio a Brasília"
                           description
= "Oferta Imperdivel"
                           finalUrls
=
                             
(UrlList){
                                 urls
[] =
                                   
"http://www.maxmilhas.com.br",
                             
}
                           price
=
                             
(MoneyWithCurrency){
                                 
ComparableValue.Type = "MoneyWithCurrency"
                                 money
=
                                   
(Money){
                                       
ComparableValue.Type = "Money"
                                       microAmount
= 228000000
                                   
}
                                 currencyCode
= "BRL"
                             
}
                       
},
                       
(PriceTableRow){
                           header
= "De Rio a Fortaleza"
                           description
= "Oferta Imperdivel"
                           finalUrls
=
                             
(UrlList){
                                 urls
[] =
                                   
"http://www.maxmilhas.com.br",
                             
}
                           price
=
                             
(MoneyWithCurrency){
                                 
ComparableValue.Type = "MoneyWithCurrency"
                                 money
=
                                   
(Money){
                                       
ComparableValue.Type = "Money"
                                       microAmount
= 596000000
                                   
}
                                 currencyCode
= "BRL"
                             
}
                       
},
                       
(PriceTableRow){
                           header
= "De Rio a Porto Alegre"
                           description
= "Oferta Imperdivel"
                           finalUrls
=
                             
(UrlList){
                                 urls
[] =
                                   
"http://www.maxmilhas.com.br",
                             
}
                           price
=
                             
(MoneyWithCurrency){
                                 
ComparableValue.Type = "MoneyWithCurrency"
                                 money
=
                                   
(Money){
                                       
ComparableValue.Type = "Money"
                                       microAmount
= 388000000
                                   
}
                                 currencyCode
= "BRL"
                             
}
                       
},
                 
},
               platformRestrictions
= "NONE"
           
}
     
},
 
}

Peter Oliquino

unread,
Nov 6, 2017, 1:09:34 AM11/6/17
to AdWords API Forum
Hi Allan,

If you wish to update your campaign level price extensions then you will need to use the CampaignExtensionSettingService instead of the CustomerExtensionSettingService. Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages