Hello Luuk,
Thank you for reaching out to us. I’m James from the Google Ads Script support team.
Upon checking with the given script, I noticed that you incorrectly set up the regex in your condition which is the main reason why you were unable to retrieve those campaigns that have ‘(B)’ in their names. Having said that, can you please try the following condition below and let me know how it goes on your end?
const pausedAndActiveAdGroups = AdsApp.adGroups()
.withCondition("campaign.name REGEXP_MATCH '.*\[(]B\[)].*'")
.get();
On the other hand, I confirm that REGEXP_MATCH should also work as well according to our documentation.
Let me know if you have any questions.
Regards,
|
||||||
Hello Luuk,
Yes, you need to use backslash followed by bracket if you’re going to interpret a parenthesis () as a character or string. I’m afraid that we don't have any documentation about this. However, I believe that this is how Javascript reads regular expressions. In-addition to that, I found this post within stockoverflow that might help you to get more information about this.
Regards,