Hi folks,
I can't seem to set the networkTargeting field using an updateCampaign
call on CampaignService. I'm using the SOAPpy framework in python.
The WSDL shows that geoTargeting is a complexType, just like
networkTargeting, however I am able to set the later simply using
dictionaries.
Any help is appreciated.
Here's some sample code that reproduces the problem:
BEGIN ADWORDS SAMPLE CODE>>>>>>>
import SOAPpy
from conf import config_dict
headers = SOAPpy.Types.headerType()
headers.email = config_dict['email']
headers.password = config_dict['password']
headers.useragent = config_dict['useragent']
headers.developerToken = config_dict['developerToken']
headers.applicationToken = config_dict['applicationToken']
headers.clientEmail = config_dict['clientEmail']
camp_service = SOAPpy.SOAPProxy('https://sandbox.google.com/api/
adwords/v13/CampaignService', header=headers)
camp_service.config.debug = 0
camp_service.getAllAdWordsCampaigns(0)
print camp_service.updateCampaign({'id': 1938, 'geoTargeting':
{'regionTargets': {'regions': ['US-CA']}}})
print camp_service.updateCampaign({'id': 1938, 'networkTargeting':
['SearchNetwork']})
<<<<<<<<<<<<<<END ADWORDS SAMPLE CODE
As shown, the second line produces:
SOAPpy.Types.faultType: <Fault soapenv:Server.userException:
java.lang.IllegalArgumentException: Can not set
com.google.ads.netapi.services.datamodel.NetworkTarget field
com.google.ads.netapi.services.campaign.CampaignData.networkTargeting
to [Ljava.lang.String;: <SOAPpy.Types.structType detail at
17938624>: ...
If I change the second call to:
print camp_service.updateCampaign({'id': 1938, 'networkTargeting':
{'networkTypes': ['SearchNetwork']}})
I get:
SOAPpy.Types.faultType: <Fault soapenv:Server.userException:
java.lang.IllegalArgumentException: Can not set
[Lcom.google.ads.netapi.services.datamodel.NetworkType; field
com.google.ads.netapi.services.datamodel.NetworkTarget.networkTypes to
[Ljava.lang.String;: <SOAPpy.Types.structType detail at
14784704>: ....
-Travis
--
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=.