Saturday, September 21, 2013

Google Ads Developer Blog

Google Ads Developer Blog


Enhancements to Google scripts documentation site

Posted: 20 Sep 2013 09:45 AM PDT

We recently enhanced the documentation site for Google scripts by including more content and improving site navigation. The major changes are:
  • A new and improved introduction to AdWords scripts.
  • A new section named "Solutions" that consolidates existing tutorials with 10 new ready-to-use scripts.
We are constantly striving to improve our documentation to make getting started with AdWords scripts even easier. If you have ideas for enhancing the documentation, let us know on our official forum or through the feedback link on each document page.

Introducing Drive support in AdWords Scripts

Posted: 20 Sep 2013 07:25 AM PDT

We are glad to announce support for Google Drive in AdWords scripts. The functionality is exposed through the DriveApp bean that allows scripts to create, find, and modify files and folders in Google Drive. Scripts uses OAuth2 as the authentication mechanism to determine which files the current user has access to on Google Drive.

One of the potential use of Drive is as an intermediary data storage between your application and your script. A couple of hypothetical use cases are:

Manage ads by inventory
  • First, install a Google Drive client locally on your computer and map a local disk folder to your "My Drive" folder in Google Drive.
  • Write an internal script to query the inventory database and dump results into an XML file to your local Google Drive folder.
  • Write an AdWords script that reads that same file using DriveApp and pauses or enables ads accordingly.
Importing stats to a local database
  • Install a Google Drive client locally on your computer and map a local disk folder to your "My Drive" folder in Google Drive.
  • Write an AdWords script that fetches daily stats and dumps them into a CSV file on Drive daily.
  • Create a local cron job to read that file and push its data into a local database.
DriveApp gives you certain advantages over SpreadsheetApp and UrlFetch APIs when exchanging data with your local server.
  • Google Spreadsheets have size limitations, and is not the format of choice for all our developers.
  • UrlFetch is more flexible than DriveApp, but it requires you to set up your own local server to exchange data with Scripts in a secure manner.
We hope you enjoy this new feature. If you have questions or feedback, please visit us on our official forum.

No comments:

Post a Comment