Yahoo! JAPAN Ads Script | Developer Center
日本語Offline Conversion
・Upload processing of offline conversion data from Google Drive(Specify file id)・Upload processing of offline conversion data from Google Drive(Specify file name)
Upload processing of offline conversion data from Google Drive(Specify file id)
function uploadProcessingOfOfflineConversionData(){
const accountId = AdsUtilities.getCurrentAccountId();
const fileId = '11111AAAAAbbbbb_-222222BBBBBccccc';
const fileData = DriveApp.getFileById(fileId).getBlob().getBytes();
const offlineConversions = Search.OfflineConversionService.upload(
accountId,
'NEW',
'sampleData.csv',
fileData
).rval;
}
Upload processing of offline conversion data from Google Drive(Specify file name)
function uploadDataSpecifyFileName() {
const accountId = AdsUtilities.getCurrentAccountId();
const fileName = 'fileName.csv';
const files = DriveApp.getFilesByName(fileName);
if(files.hasNext()){
const file = files.next();
const fileData = file.getBlob().getBytes();
const offlineConversions = Search.OfflineConversionService.upload(
accountId,
'NEW',
fileName,
fileData
).rval;
} else {
Logger.log('The specified file name does not exist on Google Drive.');
}
}