setting network targets for campaign - python, v2009

9 views
Skip to first unread message

david

unread,
Dec 9, 2009, 7:43:15 AM12/9/09
to AdWords API Forum
Hi,

How do you set the NetworkTargetList in python? In particular, I want
to create a campaign which is shown only on selected placements.

I've tried a bunch of things, which don't seem to work. I would really
like to see a completed example.

ALSO: is it possible to get better documentation with EXAMPLES for
python? What appears to be lacking is a thorough description of
operands and their formats (as in this case).

Thanks!

David

david

unread,
Dec 9, 2009, 2:35:18 PM12/9/09
to AdWords API Forum
This does NOT work:

operations = [
{
'operator': 'SET',
'operand': {
'type': 'NetworkTargetList',
'campaignId': cid,
'targets': [
{ 'type': 'NetworkCoverageType',
'networkCoverage' : 'CONTENT_NETWORK'
},
],
}
}
]

I get an error:
...

File "/home/abc/mypython2.6/lib/python2.6/site-packages/aw_api/
zsi_toolkit/SanityCheck.py", line 1430, in ValidateOperation
targets.append(ValidateTarget(item, web_services))
File "/home/abc/mypython2.6/lib/python2.6/site-packages/aw_api/
zsi_toolkit/SanityCheck.py", line 1007, in ValidateTarget
new_target.__dict__.__setitem__('_%s' % key, data)
AttributeError: 'dictproxy' object has no attribute '__setitem__'

AdWords API Advisor

unread,
Dec 10, 2009, 9:59:37 AM12/10/09
to AdWords API Forum
Hi David,

A new version of the AdWords API Python client library was released
yesterday, which includes new examples including one for setting
campaign targets:

http://code.google.com/p/google-api-adwords-python-lib/source/browse/trunk/examples/v200909/set_campaign_targets.py

Best,
- Eric Koleda, AdWords API Team
Reply all
Reply to author
Forward
0 new messages