Question regarding Predicates or AWQL

52 views
Skip to first unread message

Vasile Archeri

unread,
Sep 21, 2017, 4:24:06 AM9/21/17
to AdWords API Forum
Hi,

I've been looking around to see if there's a way to select only ad groups and ads that have a tracking template set. I'm using AdGroupService and AdGroupAdService.

This is related to an issue I'm having with processing a high volume of ad groups and ads in a single request in an application. In cases like this selecting all of them and checking each for a template is not viable and I was wondering whether there was a way to select just the ones that have one set. I also had a look at older questions in the forum and it seems this was something that other people encountered as well.

Is there any way at all to achieve this? Thanks in advance.

Vincent Racaza (AdWords API Team)

unread,
Sep 21, 2017, 6:22:56 AM9/21/17
to AdWords API Forum
Hi Vasile,

Are you referring to trackingUrltemplate of an ad group or ad? If so, then this field can be filtered on. However, you could not filter by the ad group/ads which has tracking template only as null/non-null values are not possible in the predicates currently. You need to explicitly set your values as predicates. You can do something like this in your selector (e.g. in AdGroup):

Selector selector = builder
       
.fields(AdGroupField.Id, AdGroupField.Name, AdGroupField.TrackingUrlTemplate)
       
.orderAscBy(AdGroupField.Name)
       
.offset(offset)
       
.limit(PAGE_SIZE)
       
.in(AdGroupField.TrackingUrlTemplate, "XXXXXXXXX","XXXXXXXXX","XXXXXXXXX")
       
.build();

You can follow our blog for any future updates like new releases.

Thanks,
Vincent
AdWords API Team

Vasile Archeri

unread,
Sep 21, 2017, 7:21:18 AM9/21/17
to AdWords API Forum
Thanks for clarifying Vincent. Would it be possible to request the addition of such a feature? Or perhaps adding the default value of an unset tracking template in the documentation so this can be checked?

I was hoping there would be a way to just check whether something is set at all, regardless of value. This sounds like something that could be useful for other properties/services as well.

Vincent Racaza (AdWords API Team)

unread,
Sep 21, 2017, 10:55:17 PM9/21/17
to AdWords API Forum
Hi Vasile,

A feature request has already been filed for this. However, this does not guarantee that the team will work on this and will be available soon. Kindly continue to follow our blog to check for any future updates.
Reply all
Reply to author
Forward
0 new messages