var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true});var accounts_iterator = MccApp.accounts().withCondition("LabelNames CONTAINS 'myLabel'").get();Hi Michal,
Thank you for supplying that information. Please see my responses below:
1. I was able to run the MCC version of the script within your MCC account, even with the keywords drop-down turned off. I would suggest to make the following changes in order to get the script to run:
- Make sure you are running the script from your MCC account
- In cell C16, add the CIDs of the accounts that you want to check. Right now there is an account there (#CID number#) that is not an account related to this particular MCC account. Please make sure to use correct accounts.
- Delete cells B17:D21
- Delete content in B:1
- Run script
2,Yes i know that i need to customize because i wont be able to check whole account anyway since it is so massive. I think we will be better with account level scripts anyway - 1 script for 1 account and when there is more then 20k urls to check more google accounts with more scripts to check that account selected by labels.
This solution should work. If you are looking to run the script for only 1 account you may want to look at running it on the account level (under AdWordsApp).
3. So i guess the best way to divide campaigns on account would be using line with labels from 5. right? Where should i add that line in account level script?
I was able to get the MCC account to run the script so running the script and dividing by campaigns on the account level isn't necessary. See #1
4, Any specific place i should add that line ? i'm really newbie :(
The default script has
var response = UrlFetchApp.fetch(lastUrl, { muteHttpExceptions: true});
Modify that line to read:
var response = UrlFetchApp.fetch(lastUrl, { muteHttpExceptions: true, followRedirects: true});
6. Since i might have to use account level script and it doesn't seem to check sitelinks is there a way of adding that to account level script?
For the account level there would be some refactoring needed. Please see #1 as you should be able to get this to properly run on the MCC account.
Thanks,
Tyler Sidell
AdWords Scripts Team
function createLinkCheckerLabel() {
var labels = AdWordsApp.labels().withCondition(
"Name='" + LABEL_NAME + "'").get();
if (!labels.hasNext()) {
AdWordsApp.createLabel(LABEL_NAME,
"Managed by Link Checker, please don't modify!", '#60e020');
}
}
followRedirects: true
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true});
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true, followRedirects: true});
.withCondition("Status = ENABLED")
if (response.getResponseCode() < 300)if (response.getResponseCode() < 300 || response.getResponseCode == 302)var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel +
"']")
.get();.withCondition("Status = ENABLED")
if (settings.checkKeywords) { var keywords = AdWordsApp.keywords() .withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'") .withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel + .withCondition("Status = ENABLED") "']")if (response.getResponseCode() < 300)
if (response.getResponseCode() < 300 || response.getResponseCode == 302)
var response = UrlFetchApp.fetch(url, { muteHttpExceptions: true});
if (settings.checkKeywords) {
var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel + "']")
.withCondition("Status = ENABLED")
.get();
}if (response.getResponseCode() < 300 || response.getResponseCode == 302) {
accountSheet.appendRow(['', lastUrl,
status, keyword.getCampaign().getName(),
keyword.getAdGroup().getName(),
keyword.getText(), '', '']);
}
...
ReferenceError: "settings" is not defined. (line 287)