Google Spreadsheet to AdWords Connection

63 views
Skip to first unread message

Alessio Monino

unread,
Aug 29, 2020, 8:26:30 AM8/29/20
to Google Ads Scripts Forum
Hi, my objective is to connect Google Spreadsheet to AdWords. Basically I want to update my sheet every morning with a list of campaigns that seem promising according to internal parameters and calculations of my organization. Then I want these campaigns to get activated on Google AdWords when they are added to the Google Sheet. I tried adding a script in AppsScript to a Google Spreadsheet to start the connection but keep getting this error:
ReferenceError: AdWordsApp is not defined

Any advice to solve this error or even to beeter structure this project/integration is very much appreciated.
Thanks for your help in advance,
Alessio

Dave Roeser

unread,
Aug 29, 2020, 1:38:59 PM8/29/20
to Alessio Monino via Google Ads Scripts Forum
Would you be willing to post the source code? It would make the task a tad easier.
Thanks,
Dave

Il portale dei professionisti n° 1 in Italia


This message is for the designated recipient only and may contain private information. If you have received it in error, please notify the sender and delete all copies. Any other use is prohibited.

--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/8ce2d64f-d365-4c44-81e4-3ed3f394e1bbn%40googlegroups.com.

Alessio Monino

unread,
Aug 29, 2020, 5:11:11 PM8/29/20
to Google Ads Scripts Forum
Hi, yeah I figured out my problem. I had been trying to access the AdWordsApp from the Spreadsheet and not from AdWords. I actually have a follow up on this. How would I be able to set up a menu option in the Spreadsheet that when clicked triggers the execution of the Ad Words script? 

This is what I got to up to now:

function upload_campaigns() {
  var ss = SpreadsheetApp.openByUrl(ssUrl).getSheetByName('settings');
  var data = AdsApp.bulkUploads().newFileUpload(ss);
  data.forCampaignManagement().preview();
}

function onOpen() {
  var menuItems = [
    {name: 'upload campaigns', functionName: 'upload_campaigns'}
  ];
  var ss = SpreadsheetApp.openByUrl(ssUrl)
  ss.addMenu('Google Ads', menuItems);
}

Dave Roeser

unread,
Aug 30, 2020, 3:35:36 PM8/30/20
to Alessio Monino via Google Ads Scripts Forum
Hi,
My first guess was 'no' but I found this https://developers.google.com/google-ads/scripts/docs/examples/apps-scripts-execution so maybe it is possible by using the API. I will go back into my cave and wait for the Ads script team to opine as they will likely know for sure. Apologies for not being able to help more.
Dave

Google Ads Scripts Forum Advisor

unread,
Aug 31, 2020, 12:38:42 PM8/31/20
to adwords...@googlegroups.com
Hello,

Dave, thank you for sharing that link.

Alessio -- though it is possible to execute a remote Apps script (e.g. from a spreadsheet) from an Ads script, it is not possible to execute an Ads script from a spreadsheet. Ads scripts can only be triggered in the UI, or scheduled in the UI to run automatically. 

Please let us know if you have any other scripts questions.

Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5004Q23vghj:ref
Reply all
Reply to author
Forward
0 new messages