Hi Michele,
Thanks for providing the requested details and for your patience here.
I have checked that we should update the getUrlsBySelector and checkUrls functions so that the script would not retrieve draft and experiment campaign. To do this you would need first retrieve the list of Base Campaigns IDs and filter the entity selectors with the CampaignID with something like the following:
var campaignIds = []
var campaignIterator = AdsApp.campaigns().withCondition('CampaignExperimentType = BASE').get();
while (campaignIterator.hasNext()) {
var campaign = campaignIterator.next();
campaignIds.push(campaign.getId());
}
var adIterator = adSelector.withCondition('CampaignId NOT_IN ['+ campaignIds +']').get();
while (adIterator.hasNext()) {
var ad = adIterator.next();
Logger.log(ad.getId() + ' ' + ad.getCampaign().getName());
}
I have attached here an updated version of the script for your reference where I created a separate function to retrieve the base campaign IDs on line 543 and added withCondition methods in lines 562 and 608. Please take note to update the spreadsheet URL and the email address. Kindly try this at your end and let me know how it goes.
Let me also know if there's anything else I can assist you with.