Bulk Upload

Google Ads scripts let you make bulk changes to your account by uploading data in CSV format. You can upload data from a CSV file from Google Drive, a Google spreadsheet, a Microsoft Excel spreadsheet, or construct a bulk upload request in your script at runtime. This guide explains how to use this feature in your scripts.

Usage

Using bulk uploads, you are able to make certain kinds of changes that would otherwise not be directly supported by Google Ads scripts, such as managing campaigns or uploading offline conversions.

Create bulk upload from Google Drive

The simplest way to use the bulk upload feature is to upload a CSV file in Google Drive, and upload that file into Google Ads using Google Ads scripts:

const file = DriveApp.getFilesByName("BulkCampaignUpload.csv")
    .next();
const upload = AdsApp.bulkUploads().newFileUpload(file);
upload.forCampaignManagement();
upload.preview();

This creates a bulk upload preview entry in your account under Tools and settings > BULK ACTIONS > Uploads.

Click the Preview link to view the changes.

To apply the changes to your account, click the Apply changes button on the details page. If the uploaded file has errors, or if you don't want to make the changes, then click the Discard preview button to discard the changes.

Once you've verified your script is working correctly, you can skip the preview stage and apply the changes directly from your script. This can be done by calling the apply() method of the bulk upload instance instead of the preview() method.

Create bulk upload from scratch

You can create a bulk upload job from scratch as follows:

// The best way to find column names is to consult a template
// as described in the last section of this guide.
const columns = [
   "Campaign", "Budget", "Bid Strategy type", "Campaign type"
];

const upload = AdsApp.bulkUploads().newCsvUpload(columns);

// Call append once for each row you'd like to upload
upload.append({
   "Campaign": "Test Campaign 1",
   "Budget": 2.34,
   "Bid Strategy type": "cpc",
   "Campaign type": "Search Only"
});
upload.forCampaignManagement();
upload.preview();

Set monetary unit

By default, the money amounts in bulk uploads are interpreted as the actual currency amount. If you prefer using micros, you can set the moneyInMicros option to true when creating the upload job (for example, €2.34 would be entered as 2340000).

const upload = AdsApp.bulkUploads().newCsvUpload(columns,
    {moneyInMicros: true});

Set file locale

By default, the CSV file contents are interpreted in US English locale (en_US). You can specify a different locale using the fileLocale option, as shown below:

const upload = AdsApp.bulkUploads().newCsvUpload(columns,
    {fileLocale: "fr_FR"});

When you specify a locale, you can provide the column headers either in en_US locale or in the locale you specify in the fileLocale property.

Set time zone

By default, the time entries in the file are interpreted in America/Los_Angeles. You can specify a different time zone using the timeZone option. Specify the time zone in the TZ database format.

const upload = AdsApp.bulkUploads().newCsvUpload(columns,
    {timeZone: "America/New_York"});

Setting a time zone can be useful when uploading offline conversions.

Spreadsheet templates for bulk upload

The easiest way to get a spreadsheet template for a bulk upload is from the Google Ads UI.

  • Sign in to your Google Ads account.
  • Navigate to Tools and settings > BULK ACTIONS > Uploads.
  • Click the + button to initiate a new upload.
  • A section then appears with a variety of templates to choose from.

You can also download many different templates from the help center.