Represents a Bulk Upload which can be incrementally built up in CSV format
and uploaded to the Bulk Uploads service.
Methods:
append(row)
Appends a row to the Bulk Upload.
The row object is a key-value map. For each key-value pair:
If the key exists in the provided column headers, its value will fill
into the cell corresponding to the matching column; If it doesn't
exist, the key-value pair is ignored.
// The resulting CSV bulk upload of the following code would be:
// +-------------+-------------+----------------+
// | Campaign | Campaign ID | Campaign state |
// +-------------+-------------+----------------+
// | Campaign #2 | 2001684997 | enabled |
// +-------------+-------------+----------------+
var bulkUpload = AdsApp.bulkUploads().newCsvUpload([
"Campaign",
"Campaign ID",
"Campaign state"]);
bulkUpload.append({
"Campaign":"Campaign #2",
"Campaign ID":"2001684997",
"Campaign state":"enabled"}); Arguments:
Name Type Description
row
Object
The row object to append.
Return values:
apply()
Uploads the file and applies the changes.
When previewing a script, apply()
previews the Bulk Upload instead of applying it.
Returns nothing.
forCampaignManagement()
Specifies that this upload is used for Campaign Management entity changes.
This is the default option, so this method doesn't need to be called
except to override a previous call to CsvUpload.forOfflineConversions() .
Return values:
Type Description
AdsApp.CsvUpload
The same upload specified to change Campaign Management entities.
forOfflineConversions()
Specifies that this upload is used for reporting offline conversions.
By default, uploads are used for Campaign Management entity changes, so
it's necessary to call CsvUpload.forOfflineConversions()
to make offline conversion uploads work correctly.
Return values:
Type Description
AdsApp.CsvUpload
The same upload specified to report offline conversions.
preview()
Uploads the file and previews the changes.
Returns nothing.
setFileName(fileName)
Sets the file name of the uploaded file.
Arguments:
Name Type Description
fileName
String
The file name of the uploaded file.
Return values: