External Data Integration

Important data (inventory, conversions, etc.) often reside outside the Google Ads domain. Likewise, the Google Ads UI may not always be the perfect tool for data visualization. Google Ads scripts provide an easy way to integrate with external data sources.

Google Spreadsheets

Google Spreadsheets (found in Google Drive) are a full-featured web-based spreadsheet solution. Google Ads scripts lets you read from and write to spreadsheets through the Spreadsheet Service. You can also programmatically create a spreadsheet, populate it with data, format its fonts and colors, and share it with others. Some of the ways you can use them in your scripts include:

Report visualization
Spreadsheets offer various types of charts. You can set up a spreadsheet with a chart to visualize your data, and then import the data source from a script to automatically update the chart.
Data source
You can create a spreadsheet where you manually input data (or input data from some other source). A script can then read and process the data to update your account. For example, you can enter new keywords to a spreadsheet that are then added to your account by a daily running script.
Intermediate data store
A spreadsheet can store information about its execution state as it runs, so that it can pick up where it left off on the next execution. For example, if you need to process all ad groups in your account but it takes longer than the 30 minute execution time limit, you can record the ones you process as you go. When the script executes again, it can check the spreadsheet to figure out where to start so it doesn't duplicate any work.

Google Drive

You can further leverage Google Drive with DriveApp which lets scripts create, find, and modify arbitrary files on Google Drive. This can be used as a data source or intermediate data store as previously shown.

Charts

Enhanced data visualization is also available through the Charts Service. This full-fledged chart building service gives you extensive control over your data visualization needs.

JDBC

You can connect to external JDBC-compliant databases such as Google Cloud SQL, MySQL, Microsoft SQL Server, and Oracle databases. See this guide for set-up instructions.

Email

Google Ads scripts let you send out emails through the Mail Service. Email can be used for notifying yourself of any pertinent information you need from the script; for instance, mailing out a summary with a link to a full report. You can customize the email message with custom HTML and even add images, allowing the script to send professional-looking reports directly to your clients. Attachments can be used to send large reports.

URL fetching

Google Ads scripts let you fetch the content of an arbitrary URL using the Url Fetch Service. This feature opens up a range of opportunities:

  • Set up a password-protected feed on your website that reports inventory information. Then, access it through a Google Ads script in order to apply account changes.
  • Fetch information about external events and make account management decisions based on that information. For example, you could fetch weather information from an HTTP-based API and adjust bids or enable ads whenever it's raining in your target area.
  • There are a wide variety of APIs available across the web; anything that has an HTTP interface is accessible.