Thanks for your help Mat.
I'm using the AdWords API Python library so looking at your first example.
I tried multiple ways (and went searching on Google again) but no luck.
This is what I thought might be the closest. Any thoughts would be much
appreciated.
list_of_keywords_counted = ['keyword 1', 'keyword 2']
list_of_keywords = ', '.join(str(e) for e in list_of_keywords_counted)
.
.
.
AND KeywordTextMatchingQuery IN [{}].format(" + list_of_keywords + ")
On Thursday, September 3, 2020 at 3:17:26 AM UTC+12 Mat wrote:
> Hi Green Leaf,
>
> some alternative to my solution you've linked would be to convert the list
> into a string using "join()" and/or insert that string into the query using
> ".format().
>
>
> keyword_list = ["keyword1", "keyword2", "keyword3"]
> *keyword_list_as_string* = ', '.join(str(e) for e in keyword_list)
>
> #This should work with the AdWords API Python library:
> query = ('SELECT Id, Criteria, AdGroupName FROM
> KEYWORDS_PERFORMANCE_REPORT '
> 'WHERE somecondition '
> 'AND KeywordTextMatchingQuery IN [*{}*]'.format(*keyword_list_as_string*)
> )
>
> #And this is a Python example that does work with the Google Ads API
> Python library:
> shared_set_ids = [1234, 5678, 2345]
> *shared_set_ids_as_string* = ', '.join(str(e) for e in shared_set_ids)
> query = ('SELECT '
> 'shared_criterion.criterion_id, '
> 'shared_criterion.keyword.match_type, '
>
> 'shared_criterion.keyword.text, '
> 'shared_criterion.type, '
> 'shared_set.id '
> 'FROM shared_criterion '
> 'WHERE shared_set.id IN (*{}*) '
> 'AND shared_set.status = ENABLED '
> 'AND shared_set.type = NEGATIVE_KEYWORDS'.format(
> *shared_set_ids_as_string*)
> )
>
>
> Regards
> Mat
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads 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=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/a4d8e9e4-8f2d-45de-ad90-c74ec4f239d0n%40googlegroups.com.