How to filter accounts by label and a word in the account name?

208 views
Skip to first unread message

joysdepraved

unread,
Jul 6, 2017, 10:16:59 AM7/6/17
to AdWords Scripts Forum
Currently I have the following line in my script :

var accountSelector = MccApp.accounts().withCondition("LabelNames CONTAINS 'Group A'");

As it is obvious I am selecting only the accounts that contain the label "Group A", but unfortunately this is not enough for me. 

I need need queries for two scenarios. Firstsly, I need a query which selects the accounts that contain the label "Group A" and do not have the word Brand in their name. 

Then I need similar query, which selects the accounts that contain the label "Group A" and contain the word Brand in their name.

An example for account name with the word brand would be AT|Oestereich Brand 6789-AT.

Can somebody give my a tip or guide me how to do this? Is it possible at all? I am trying to do it in this script.



Anthony Madrigal

unread,
Jul 6, 2017, 10:32:04 AM7/6/17
to AdWords Scripts Forum
Hello,

You can use the following conditions to select accounts with label Group A and contain Brand in its name:
var accountSelector = MccApp.accounts().withCondition("LabelNames CONTAINS 'Group A'").withCondition("AccountDescriptiveName CONTAINS Brand");

For the other query, you can use DOES_NOT_CONTAIN instead of CONTAINS.

Cheers,
Anthony
AdWords Scripts Team
Reply all
Reply to author
Forward
Message has been deleted
0 new messages