N-Gram/Brainlabs Search Query Mining Tool Script Not Working

838 views
Skip to first unread message

kris boorman

unread,
May 26, 2021, 4:04:41 AM5/26/21
to Google Ads Scripts Forum
Hi,

In the past I've used the Brainlabs' Search Query Mining Tool script. I've tried using it for the first time in a couple years, but it doesn't seem to be working.

When it finishes running (without error), it tells me: 

26/05/2021 09:02:36
Could not find any campaigns with impressions and the specified options.

This isn't right as we have campaigns that meet the script's requirements.

I've seen that a forum advisor here was able to solve the issue for another user, I'm happy to email my script.

Thank you!
Kris

Google Ads Scripts Forum Advisor

unread,
May 26, 2021, 5:59:34 AM5/26/21
to adwords...@googlegroups.com
Hi Kris,

Thanks for reaching out. Harry here, from the Google Ads Script Team.

Kindly provide the script name and your CID so that I could check this on our end. You may send them here or privately via the reply to author option. Note that you may need to join the Google Group for you to use this option. If this option is not available at your end still, you may send it through our email (googleadsscr...@google.com) instead.

Looking forward to your reply.

Thanks,
Google Logo
Harry Cliford Rivera
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2Hxvdx:ref

kris boorman

unread,
May 26, 2021, 8:40:02 AM5/26/21
to Google Ads Scripts Forum
Hi Harry,

Thanks for replying - I'll send via email.

Cheers
Kris

On Wednesday, 26 May 2021 at 10:59:34 UTC+1 adsscriptsforumadvisor wrote:
Hi Kris,

Thanks for reaching out. Harry here, from the Google Ads Script Team.

Kindly provide the script name and your CID so that I could check this on our end. You may send them here or privately via the reply to author option. Note that you may need to join the Google Group for you to use this option. If this option is not available at your end still, you may send it through our email (googleadsscripts-support@google.com) instead.

Google Ads Scripts Forum Advisor

unread,
May 26, 2021, 11:05:54 PM5/26/21
to adwords...@googlegroups.com

Hi Kris,

Thanks for providing the requested details. It seems that you encounter the same issue with the user in the thread you are referring to so allow me to reiterate the provided solution here. The issue is with the report query that is around line 99 where the campaignNameContains is set to an empty string. When you set a WHERE clause to compare with an empty variable, it won't be just ignored. The report query will still run with the conditions you set (campaignNameContains = ''). With the way that the script was coded, I would suggest that you remove line 103, replace "AND" with "WHERE" on line 104 and write another if statement before line 90 that would look like the code below:

if (campaignNameContains != "") {
    whereStatements += "AND CampaignName CONTAINS_IGNORE_CASE '" + campaignNameContains + "' ";
}

This will check if you have set anything in the campaignNameContains variable (line 27). You can test the issue out on your end by copying lines 99-110 into a new script. Declare the variables campaignNameContains, whereStatements, and activeCampaignIds, then remove the WHERE clause and replace "AND" with "WHERE". It will log the same message if it did not capture any campaigns and you may add an else statement to see if it captured campaigns.

Kindly try and let me know how it goes.

Thanks,

kris boorman

unread,
Jun 1, 2021, 5:39:53 AM6/1/21
to Google Ads Scripts Forum
Hi Harry,

Apologies for the delay - works perfectly thank you so much.

Cheers
Kris
Reply all
Reply to author
Forward
0 new messages