|
||||||
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.
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,