I am trying to fetch google Adwords reporting data (clicks,cost..etc) of specific addGroup with Google Ads Query Language buts saying CONTAINS ANY is not a valid operator to use with 'ad_group.name', here is my query

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name CONTAINS ANY ('pmp')" 

I need to fetch similar addgroup by name similar to SQL like '%%', there is a LIKE command in GAQL but its working like = , eg for add group = 'test-exam' this works

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name LIKE ('test-exam')" 

but this returns nothing

"query": "SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group where ad_group.name CONTAINS ANY ('test')" 

Tag:google-ads-api

Only one comment.

  1. Dave Davis

    You need to use the SQL percentage syntax for the LIKE statement in GAQL too.

    So:

    SELECT ad_group.name, metrics.impressions,metrics.clicks FROM ad_group WHERE ad_group.name LIKE '%test-exam%'

    This works for me. I think 'CONTAINS' only works with the older AdWords API.

Add a new comment.