AdWords
4K members online now
4K members online now
Use AdWords conversion tracking and reporting to measure your results. Have a question about Google Analytics? Post it here, on the Google Analytics Community!
Guide Me
star_border
Reply

DocumentApp not defined

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I have a script where i need to read the campaign names from a Google Sheet. But when i use DocumentApp it keeps giving me a ReferenceError: "DocumentApp" is not defined .

var files = DriverApp.getFilesByName('CampaignReport');
while
(files.hasNext()) { var file = files.next(); var Id = file.getId(); var content = DocumentApp.openById(Id).getBody().getText(); Logger.log(content);
}

Why do I keep getting this error. Else suggest me a way to read from a Google Sheet in Adwords script 

1 Expert replyverified_user

Re: DocumentApp not defined

Top Contributor
# 2
Top Contributor
Hi AdWords M
Is this the whole script?
DocumentApp is, as the error says, not defined anywhere.
If you're trying to put the data from the campaign report into a apps document/spreadsheet, you need to create it first. E.G, var doc = DocumentApp.create('Hello, world!');

Did you get this resolved?