Exact Match Script

399 views
Skip to first unread message

Chris Lantzy

unread,
Jun 13, 2022, 11:34:01 PM6/13/22
to Google Ads Scripts Forum
I was using this script before the new scripts experience launched and it worked as described. After the Beta was released, the script made changes to multiple campaigns instead of the campaign specified in the instructions:

var campaignNameContains = [];

// Use this if you only want to look at some campaigns. Case insensitive.

// For example ["Brand"] would only look at campaigns with 'brand' in the name,

// while ["Brand","Generic"] would only look at campaigns with 'brand' or 'generic'

// in the name.

// Leave as [] to include all campaigns.

I've disabled all scripts until I can understand what needs to be changed. Here is the link to BrainLabs where I got the script https://www.brainlabsdigital.com/marketing-library/exact-match-script

Thanks to anyone who can help!

Chris

Google Ads Scripts Forum Advisor

unread,
Jun 14, 2022, 5:09:30 AM6/14/22
to adwords...@googlegroups.com

Hi Chris,

 

I am Maia from the Google Ads Scripts team. Thank you for reaching out to us.

 

I'm afraid that we do not have access to BrainLabs where the ready-made Scripts are. However, kindly share with us the following details below so that we can investigate further:

 

  • Google Ads CID
  • Script Name (where you have implemented the Script from BrainLabs)

 

Kindly send the requested details above via ‘Reply privately to author’ option. However, if the private option is not available on your end, then please send it over through this email <googleadsscr...@google.com> instead.

 

In addition, have you also executed the Scripts recently in the old(legacy) Google Ads Scripts (by turning off the New Experience)? If so, is it still behaving differently from the expected?

 

Best Regards,

Google Logo
Angel Maia
Google Ads Scripts Team
 

 

ref:_00D1U1174p._5004Q2bw6Ak:ref

Chris Lantzy

unread,
Jun 15, 2022, 4:19:26 AM6/15/22
to Google Ads Scripts Forum
I was using the Exact Match Script from BrainLabs and it was working fine before the new scripts experience launched. After the launch, this script made changes to multiple campaigns instead of the one specified in the var campaign instruction. Has anyone developed a workaround or update to this script?

Google Ads Scripts Forum Advisor

unread,
Jun 15, 2022, 11:36:59 AM6/15/22
to adwords...@googlegroups.com
Hi Chris,

Thanks for reaching out. This third party scripts website has a contact form. I would recommend checking with the script author to see what recommendations they have for the new scripts experience. 

Regards,

Google Logo
Matt
Google Ads Scripts Team
 

 

ref:_00D1U1174p._5004Q2bwXmO:ref

Chris Lantzy

unread,
Jul 14, 2022, 12:17:12 PM7/14/22
to Google Ads Scripts Forum
Hi Matt,

Thank you for getting back to me. I just saw this response yesterday. I'm wondering how long we will be able to run the legacy scripts experience, do you have a timeline when it will sunset?

Regards,
Chris

Chris Lantzy

unread,
Jul 14, 2022, 12:38:13 PM7/14/22
to Google Ads Scripts Forum
Hi Matt,

Regarding the Organizing selectors in the guide,
The exact match script used: var campaignNameContains = "some_campaign_name";

Should this be modified to: var campaign.name = " some_campaign_name";

Thanks,
Chris
Capture.PNG

Larry Sanderson

unread,
Jul 14, 2022, 12:43:15 PM7/14/22
to Google Ads Scripts Forum
Hi Chris,

I looked at the Brain Labs script, and the meat of the script is (rewritten a bit):

const campaignReport = AdWordsApp.report(
  `SELECT CampaignId FROM CAMPAIGN_PERFORMANCE_REPORT WHERE CampaignStatus = ENABLED AND CampaignName CONTAINS_IGNORE_CASE 'Brand' AND CampaignName DOES_NOT_CONTAIN_IGNORE_CASE 'Generic' DURING LAST_30_DAYS`);

This should definitely still work correctly. Can you share the values you're using in your script for campaignNameContains, campaignNameDoesNotContain as well as a few examples of campaign names that are being selected that shouldn't? That should give me enough info to reproduce your issue. Thanks!

Larry Sanderson

unread,
Jul 14, 2022, 12:53:43 PM7/14/22
to Google Ads Scripts Forum
Chris, that change would only help if you also changed the 'FROM CAMPAIGN_PERFORMANCE_REPORT' to the new version: 'FROM campaign'

For the New Scripts Experience, we are attempting to translate the old queries, so in general they should continue to work. In this case, the translation should succeed, but we may have a bug that's causing your use-case to fail. If I can put together an example script that demonstrates the error, I should be able to resolve the issue.

Google Ads Scripts Forum Advisor

unread,
Jul 15, 2022, 2:05:29 AM7/15/22
to adwords...@googlegroups.com

Hello Chris,

I’m James, also from the Google Ads scripts support team. Allow me to assist you.

To answer your questions, based on our blog, existing scripts running in the legacy version of script won't be affected until September of 2022. After that, we will migrate all scripts to the new experience. You should manually move your scripts over to the new experience before then to ensure continued functionality. We've tried to implement backwards compatibility, but we can't guarantee every script will work without changes, so definitely take some time to confirm yourself. You may refer to this migration guide for more information.

On the other hand, you may refer to this resource mapping document to see the equivalent fields to the new script experience of a specific entity. Moreover, I agree with the context provided by Larry.You may also use this query migration tool on how you can convert your existing AWQL query to GAQL query which is now mainly supported in the new script experience. 

@Larry - We appreciate your effort sharing your insights here.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2bwXmO:ref

Chris Lantzy

unread,
Jul 15, 2022, 12:53:43 PM7/15/22
to Google Ads Scripts Forum
Hello Google Scripts Team!

Thanks for staying on top of this case with me. We deployed the Brain Labs "Make Phrase Match Exact Script" with the New scripts experience Enabled. Here is the portion of the script where values were entered for campaignNameDoesNotContain, campaignNameContains and makeChanges, emailAddresses, etc:

// ID: 63aae9b1d305a9c84d358f813de0f675
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//Options

// Use this if you want to exclude some campaigns. Case insensitive.
// For example ["Brand"] would ignore any campaigns with 'brand' in the name,
// while ["Brand","Competitor"] would ignore any campaigns with 'brand' or
// 'competitor' in the name.
// Leave as [] to not exclude any campaigns.
var campaignNameDoesNotContain = [];


// Use this if you only want to look at some campaigns.  Case insensitive.
// For example ["Brand"] would only look at campaigns with 'brand' in the name,
// while ["Brand","Generic"] would only look at campaigns with 'brand' or 'generic'
// in the name.
// Leave as [] to include all campaigns.
var campaignNameContains = ["SR | Search | Liver | Milk Thistle | Broad"];

//Choose whether the negatives are created, or if you just get an email to review
var makeChanges = true;

// These addresses will be emailed when the tool is run, eg "dan...@example.com"
// If there are multiple addresses then separate them with commas, eg "a...@a.com, b...@b.com"
// Leave as "" to not send any emails
var emailAddresses = " dan...@example.com";

// The tool will only compare keywords with search queries
// that have received over this many impressions.
var impressionsThreshold = 0;

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//

The script added many phrase match negatives to multiple campaigns other than SR | Search | Liver | Milk Thistle | Broad, including:
SR | Search | Brand CTA | Testosterone | Muscle | Broad
SR | Search | Hair Vitamins | Broad
SR | Search | Probiotics | Broad
SR | Search | Brand CTA | Fish Oil | Broad
SR | Search | Brand CTA | B12 | Broad

Please let us know if you have a workaround for the Phrase and Exact match scripts from Brain Labs. 

Regards,
Chris

Google Ads Scripts Forum Advisor

unread,
Jul 18, 2022, 11:31:04 PM7/18/22
to adwords...@googlegroups.com

Hello Chris,

Thank you for sharing a portion of the script that you’re using. However, since you’re using a third party script which is being created and maintained by brainlabsdigital.com, it’s best if you raise your concern to their support team through this link as they are more knowledgeable on the implementation of their own script. Take note that third party scripts are already outside of our expertise. Moreover, you may also provide our migration document to them in order for them to make adjustments to their script in order to work properly in the new script experience environment.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2bwXmO:ref

Larry Sanderson

unread,
Jul 18, 2022, 11:57:46 PM7/18/22
to Chris Lantzy via Google Ads Scripts Forum
Chris, thank you so much for posting the details of the erroring script. It turns out, we have a bug with how our query translator handles those vertical bar characters, "|". I have created an internal bug.

In the meantime, you could update the script to use the new query syntax directly so it doesn't have to use the translator, but that might require a bit of work on your part - it might be easier to reach out to the original author and see if they can update it.

The fix isn't too bad - no promises, but I should be able to get it out by the end of the week.

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/fc0dfee8-852c-4bd1-9321-b6edd30975aen%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages