ReferenceError: "AdWordsApp" is not defined

1,176 views
Skip to first unread message

Maor Uliel

unread,
Nov 10, 2016, 7:38:30 AM11/10/16
to AdWords Scripts Forum
Hi,

I've wrote a function that export ads data from 14 and 180 days ago:
function Export(ss, Ads180, Ads14){
 var newDate = Utilities.formatDate(new Date(), "GMT", "yyyyMMdd");
 var SixMonths = Utilities.formatDate(subDays(new Date(),180), "GMT", "yyyyMMdd");
 var TwoWeeks = Utilities.formatDate(subDays(new Date(),14), "GMT", "yyyyMMdd");
 var report = AdWordsApp.report(
   "SELECT AdGroupName,Headline, Description1, Description2, HeadlinePart1, HeadlinePart2, Description, Impressions, Ctr, Conversions, Id" +
       " FROM AD_PERFORMANCE_REPORT" +
       " WHERE Status='ENABLED' AND CampaignName="+campaignName+
       " DURING "+SixMonths+","+newDate+"");
 report.exportToSheet(Ads180);
 report.exportToSheet(ss.getSheetByName('Summary'));
  
  
  report = AdWordsApp.report(
   "SELECT AdGroupName,Headline, Description1, Description2, HeadlinePart1, HeadlinePart2, Description, Impressions, Ctr, Conversions, Id" +
       " FROM AD_PERFORMANCE_REPORT" +
       " WHERE Status='ENABLED' AND CampaignName="+campaignName+
       " DURING "+TwoWeeks+","+newDate+"");
  

 report.exportToSheet(Ads14);  

}

When I call it from a Spreadsheet, via:
function main()
I get the error: "ReferenceError: "AdWordsApp" is not defined"

Can you please advise?

Thanks
Maor

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 10, 2016, 10:47:09 AM11/10/16
to AdWords Scripts Forum
Hi Maor,

Thanks for reaching out.  Usually this error is due to running a single account script on the MCC level.  Are you running this on your MCC account?

Regards,
Tyler Sidell
AdWords Scripts Team

Maor Uliel

unread,
Nov 11, 2016, 2:08:18 PM11/11/16
to AdWords Scripts Forum
Hi Tyler,

I'm running it on a single account.
But i'm not running it from the AdWords scripts, but from a Spreadsheet.
Is it possible to run AdWordsApp from script in spreadsheet?

Thanks.
Maor
Message has been deleted
Message has been deleted

Maor Uliel

unread,
Nov 14, 2016, 3:08:03 AM11/14/16
to AdWords Scripts Forum
Hi Tyler,
Thanks for your response.
I've added the library as you said, but I get a realy strange error: "ScriptyApp" is not defined

Thanks again for your help.
Maor


On Friday, November 11, 2016 at 10:14:48 PM UTC+2, Tyler Sidell (AdWords Scripts Team) wrote:
Hi Maor,

You can run AdWordsApp from within a spreadsheet but you'll first have to import the library.  In the Script Editor, you can go to Resources -> Libraries.  Then, you would have to import this library, by searching for the following project key 12qYtxFp9Rzt6KIn9BkgXLAQpjyLCeA72VwA9xG_jjtK-7aIljCrPHvZs.  

Thanks,
Tyler Sidell
AdWords Scripts Team

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 14, 2016, 10:18:14 AM11/14/16
to AdWords Scripts Forum
Hi Maor,

The error that you now are seeing is not related to the AdWords Scripts library but in fact it is a App Scripts library that is not included.  I'd suggest reaching out to App Scripts team for additional information.  It looks like you need to import another library (ScriptyApp).

Thanks,
Tyler Sidell
AdWords Scripts Team

Maor Uliel

unread,
Nov 15, 2016, 8:48:39 AM11/15/16
to AdWords Scripts Forum
Thank you Tyler

Trevor

unread,
Nov 16, 2016, 1:43:40 PM11/16/16
to AdWords Scripts Forum
Hi Tyler,

Is there a reason the reference to the project key and library was deleted? I was planning on building an App Script that used that library but if it'll cause issues or isn't supported it may not be worth it.

Thank you!

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 16, 2016, 2:02:24 PM11/16/16
to AdWords Scripts Forum
Hi Trevor,

That library is not supported at the moment.  We had to remove it from the forum.

Thanks,
Tyler Sidell
AdWords Scripts Team

ce...@base.digital

unread,
Mar 27, 2018, 4:09:52 PM3/27/18
to AdWords Scripts Forum
Hi Tyler,

Is there some news about this or that library is not supported anymore?
I need integrate spreadsheet to AdWords in that order.

Tks

Thea Vega (AdWords Scripts Team)

unread,
Mar 28, 2018, 1:16:55 AM3/28/18
to AdWords Scripts Forum
Hi,

As what Tyler have mentioned, that library is currently not supported.

If you haven't yet, you may follow our blog for updates and new releases.

Thanks,
Thea
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages