RE: Filter Campaigns by label

121 views
Skip to first unread message
Message has been deleted

Google Ads API Forum Advisor

unread,
Oct 6, 2021, 1:39:11 AM10/6/21
to ti...@swydo.com, adwor...@googlegroups.com

Hi Tiana,

 

Can you try to filter by label ID (not by name), and see if you'd still encounter any issues? You may check this link for reference. Let me know how it goes. Please provide the complete request and response logs with request ID if you still encountered an error. You may send these to me via Reply privately to author option.

 

On the other hand, I've deleted your post as it contains generated logs on your end. However, pasting below the body of your concern:

"Hi there,

 

I'm trying to filter the Campaigns resource by label. The query I'm using looks as follows:

SELECT campaign.labels, metrics.impressions FROM campaign WHERE metrics.impressions > 0 AND segments.date >= '2021-08-29' AND segments.date <= '2021-09-27' AND campaign.labels CONTAINS ANY ('customers/xxxxxxxxxx/labels/xxxxxxxxxx')

 

I confirmed this is a valid query using the query validator, but when using it I'm getting the following error:

..redacted generated logs here..

 

Thanks in advance,

 

Tiana"

 

Regards,

Google Logo
Kevin Gil Soriano
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PGwrm:ref

Tiana S.

unread,
Oct 6, 2021, 2:05:07 AM10/6/21
to AdWords API and Google Ads API Forum
Hi Kevin,

Thanks so much for your response and updating the post!
L
I indeed tried with just sending the IDs but then I get an error stating it needs to be formatted as 'customers/xxxxxxxxxx/labels/xxxxxxxxxx'.

I will get back to you privately with the requested info asap! 

Best,

Tiana

Google Ads API Forum Advisor

unread,
Oct 6, 2021, 11:11:15 PM10/6/21
to ti...@swydo.com, adwor...@googlegroups.com

Hello Tiana,

Thanks for sharing us the logs privately.

I've checked on your query and this should be valid as per the Query Validator. As per further checking, when you remove this filter (metrics.impressions > 0) on your 2nd query, it should now run successfully. That said, allow me to raise this with the team if this is an expected behavior or if there are any underlying issues related to this. We'll be updating this thread for any available information.

Regards,

Google Logo
Mark Kevin Albios
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PGwrm:ref

Tiana S.

unread,
Oct 7, 2021, 8:34:33 AM10/7/21
to AdWords API and Google Ads API Forum
Hi Mark,

Thanks so much for looking into this! I removed the (metrics.impressions > 0) part from the query as well, but unfortunately I'm still getting the same error.
The query now: 

SELECT campaign.labels FROM campaign WHERE campaign.labels CONTAINS ANY ("customers/5637846722/labels/21453140713") AND segments.date >= '2021-09-07' AND segments.date <= '2021-10-06'

I'll send the error with request ID privately!

Best,

Tiana

Tiana S.

unread,
Jan 10, 2022, 11:54:04 AM1/10/22
to AdWords API and Google Ads API Forum
Hi Mark,

Just wondering if there's any update on this issue?

Thank you,

Tiana

On Thursday, 7 October 2021 at 05:11:15 UTC+2 adsapi wrote:

Google Ads API Forum Advisor

unread,
Jan 18, 2022, 5:56:43 PM1/18/22
to ti...@swydo.com, adwor...@googlegroups.com
Hello Tiana,

I looked into this for you. It looks like this has now been fixed. Can you please give it a try? If it's still not working as expected, please get back to me on this thread.

Thanks,
Google Logo
Nadine Wang
Google Ads API Team
 


ref:_00D1U1174p._5004Q2PGwrm:ref

Tiana S.

unread,
Jan 31, 2022, 4:01:41 AM1/31/22
to Google Ads API and AdWords API Forum
Thanks Nadine!

Forgot to message,  but confirmed that it works now.

Google Ads API Forum Advisor

unread,
Jan 31, 2022, 10:45:45 AM1/31/22
to ti...@swydo.com, adwor...@googlegroups.com
Greetings!

Thanks for getting back to me. I'm so happy to hear that it's working for you now.

Take care,
Nadine, Google Ads API Team

ref:_00D1U1174p._5004Q2PGwrm:ref
Reply all
Reply to author
Forward
0 new messages