Hello Jake,
If you are trying to use the script provided by "Jon" in the discussion you linked, you may modify the code below to fetch and update Ad groups. You may also refer to
AdGroupSelector,
AdGroup methods,
AdSelector and
Ad methods.
original code from the link you provided:
var campState = (precipitation > 0) ? true : false; //will be true if it's raining, false if not
var theCamp = AdWordsApp.campaigns()
.withCondition("Name = 'your campaign name'")
.get().next();
if (campState) {
theCamp.pause();
} else {
theCamp.enable();
}
modified code to fetch and update Ad groups:
var adGrpState = (precipitation > 0) ? true : false; //will be true if it's raining, false if not
var theAdGroup = AdWordsApp.adGroups()
.withCondition("CampaignName = 'INSERT_YOUR_CAMPAIGN_NAME' AND Name = 'INSERT_YOUR_ADGROUP_NAME'")
.get().next();
if (adGrpState) {
theAdGroup.pause();
} else {
theAdGroup.enable();
}
I would suggest that you test this script using the Preview button first to see possible changes.
Please let me know how it goes after doing the suggestion.
Regards,
Hiroyuki
AdWords Scripts Team