Parentheses in selector predicates

62 views
Skip to first unread message

Dmitry Trager

unread,
Aug 6, 2020, 2:11:35 PM8/6/20
to AdWords API and Google Ads API Forum
Say I use AdGroupCriterionService and make request with predicates in selector.
I've just found that when my predicate is like {:field=>"CampaignName", :operator=>"CONTAINS", :values=>["ED Supplements - US/CAN/AUS/NZ (UMZU)"]} request does not go properly.

Looks like this is b/c of parentheses, without this symbols everything works as expected.
Is this a bug or I can escape parentheses somehow?

Thanks.

Google Ads API Forum Advisor Prod

unread,
Aug 10, 2020, 2:59:36 PM8/10/20
to adwor...@googlegroups.com
Hi Dmitry,

It doesn't look like parentheses can be escaped in your predicate. Single and double quotes can be escaped. You can find more details here.

Regards,
Anthony
Google Ads API Team 

ref:_00D1U1174p._5004Q23IDX3:ref

Dmitry Trager

unread,
Aug 10, 2020, 3:35:14 PM8/10/20
to AdWords API and Google Ads API Forum
Not sure I understand correctly.

But why it should be escaped?
Do you want to say that there is no way to use parentheses directly in filter?

Google Ads API Forum Advisor Prod

unread,
Aug 11, 2020, 12:18:23 PM8/11/20
to adwor...@googlegroups.com
Hi Dmitry,

The parentheses should not cause issues with your request. Can you please send me the full request and response so I can further check whether this is a bug or not?

Thanks,

Dmitry Trager

unread,
Aug 17, 2020, 4:00:09 AM8/17/20
to AdWords API and Google Ads API Forum
This was my report definition:

map[__rdxml:[  <reportDefinition xmlns="https://adwords.google.com/api/adwords/cm/v201809">
    <selector xmlns="https://adwords.google.com/api/adwords/cm/v201809">
      <fields>AdGroupId</fields>
      <fields>AdGroupName</fields>
      <fields>BiddingStrategyType</fields>
      <fields>CampaignId</fields>
      <fields>CampaignName</fields>
      <fields>CpcBid</fields>
      <fields>CpmBid</fields>
      <fields>Criteria</fields>
      <fields>Id</fields>
      <fields>Status</fields>
      <predicates>
        <field>CampaignName</field>
        <operator>CONTAINS</operator>
        <values>ED Supplements - US/CAN/AUS/NZ (UMZU)</values>
      </predicates>
      <predicates>
        <field>CampaignId</field>
        <operator>IN</operator>
        <values>821001740</values>
        <values>930389013</values>
        <values>1022865348</values>
        <values>1076001569</values>
        <values>1338901418</values>
        <values>1423003627</values>
        <values>1423262337</values>
        <values>1424550182</values>
        <values>1425627066</values>
        <values>1428637669</values>
        <values>1429631006</values>
        <values>1434814772</values>
        <values>1434858140</values>
        <values>1434858149</values>
        <values>1435545544</values>
        <values>1492161747</values>
        <values>1533460315</values>
        <values>1533538060</values>
        <values>1664265968</values>
        <values>1705418620</values>
        <values>1739813473</values>
        <values>1776531284</values>
        <values>1776759550</values>
        <values>1777794474</values>
        <values>1791901841</values>
        <values>1791901844</values>
        <values>1912193241</values>
        <values>2081963276</values>
        <values>2081963279</values>
        <values>2081963402</values>
        <values>2081963405</values>
        <values>2081963408</values>
        <values>2081963411</values>
        <values>9472042683</values>
        <values>9472177131</values>
        <values>10757833581</values>
      </predicates>
    </selector>
    <reportName>keyword</reportName>
    <reportType>KEYWORDS_PERFORMANCE_REPORT</reportType>
    <dateRangeType>ALL_TIME</dateRangeType>
    <downloadFormat>CSV</downloadFormat>
  </reportDefinition>]]

It was returning wrong results and noting changed when I used "ED Supplements - US/CAN/AUS/NZ (UMZU) - Manual CPC Test" as a value, for example.
These two searched could not return the same result, it was definitely wrong.
But when I removed "(UMZU)" part, results became predictable again.

Google Ads API Forum Advisor Prod

unread,
Aug 17, 2020, 3:43:31 PM8/17/20
to adwor...@googlegroups.com
Hi Dmitry, 

Thanks for this info. I'll take a look and let you know what we find. 

Regards,

Dmitry Trager

unread,
Oct 12, 2020, 1:22:00 PM10/12/20
to AdWords API and Google Ads API Forum
Any updates on this?

Google Ads API Forum Advisor Prod

unread,
Jan 11, 2021, 10:33:55 AM1/11/21
to adwor...@googlegroups.com
Hello,

I apologize for the slow turnaround here. Unfortunately, we still have not been able to make progress on this issue because we are focusing all our efforts on the new Google Ads API. Since we will eventually be shutting down the AdWords API (although we haven't announced a specific timeline yet), I recommend you migrate to the Google Ads API instead.

You can use the same credentials and developer token you're currently using for the AdWords API. You can get started with the documentation here: https://developers.google.com/google-ads/api/docs/start

Regards,
Mike, Google Ads API Team

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