checkCriteria - How To

11 views
Skip to first unread message

Monty808

unread,
Apr 8, 2009, 10:59:54 PM4/8/09
to AdWords API Forum
Hi,

I am using Python to check for checking criteria but I get an error.
Per the docs, if AdGroupId is added ...I can leave out language and
geo targeting.

So....how to I fix?

Thanks

Here is an example:

check = {}
check['text'] = 'Test2'
check['type'] = 'Exact'
check['adGroupId'] = '111111111'
check['maxCpc']=str(20000)
list_crit_obj = [check]

criteria = criterion_service.CheckCriteria(list_crit_obj)

Here is my error:

Traceback (most recent call last):
File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/
google_update_keywords.py", line 189, in <module>
crit_error = crit.checkCriteria(list_crit_obj)
File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/
google_update_keywords.py", line 106, in checkCriteria
criteria = criterion_service.CheckCriteria(list_crit_obj)
TypeError: CheckCriteria() takes exactly 4 arguments (2 given)

David Montgomery

unread,
Apr 8, 2009, 11:59:59 PM4/8/09
to AdWords API Forum
ps..I added check['criterionType']='Keyword' but...still this error...

raceback (most recent call last):
File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/google_update_keywords.py",
line 214, in <module>
crit_error = crit.checkCriteria(list_crit_obj)
File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/google_update_keywords.py",
line 105, in checkCriteria
criteria = criterion_service.CheckCriteria(list_crit_obj)
TypeError: CheckCriteria() takes exactly 4 arguments (2 given)


AdWords API Advisor

unread,
Apr 13, 2009, 3:22:25 PM4/13/09
to AdWords API Forum
Hello David,

Could you try calling the method with an empty list for the
langauge_target parameter, and empty dictionary for the geo_target,
like

response = criterion_service.CheckCriteria(list_crit_obj, [], {})

Does that work?

Cheers,
-Jeff Posnick, AdWords API Team


On Apr 8, 11:59 pm, David Montgomery <davidmontgom...@gmail.com>
wrote:
> ps..I added check['criterionType']='Keyword' but...still this error...
>
> raceback (most recent call last):
>   File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/google_update_keywords.py",
> line 214, in <module>
>     crit_error = crit.checkCriteria(list_crit_obj)
>   File "/home/davidmontgom/workspace/ans_console_adnetscales4/cgi-bin/google_update_keywords.py",
> line 105, in checkCriteria
>     criteria = criterion_service.CheckCriteria(list_crit_obj)
> TypeError: CheckCriteria() takes exactly 4 arguments (2 given)
>
Reply all
Reply to author
Forward
0 new messages