Get Adsense data directly to your google sheet. Here is the app script for this.

 


function generateReport() {
 var ss = SpreadsheetApp.openById("SHEET ID HERE");
 var sheet = ss.getSheetByName('adsense1');
 var adnetwork = "ADSENSE";
 var startDate = getYesterdayDate();
 var endDate = getYesterdayDate();
 var adClientId = "ca-pub-ADSENSE PUB ID HERE";
 var args = {
 'filter': ['AD_CLIENT_ID==' + adClientId],
 'metric': ['AD_REQUESTS', 'MATCHED_AD_REQUESTS', 'EARNINGS', 'CLICKS'],
 'dimension': ['AD_UNIT_NAME'],
 'sort' : ['-EARNINGS'],
 'useTimezoneReporting' : ['true']
 };
 var report = AdSense.Reports.generate(startDate, endDate, args).getRows();
 for (var i=0; i<report.length; i++) {
 var row = report[i];
 var earning = row[4];
 if(earning != 0)
 {
 sheet.getRange('A' + String(i+2)).setValue(row[0]);
 sheet.getRange('B' + String(i+2)).setValue(adnetwork);
 sheet.getRange('C' + String(i+2)).setValue(row[1]);
 sheet.getRange('D' + String(i+2)).setValue(row[2]);
 sheet.getRange('E' + String(i+2)).setValue(row[3]);
 sheet.getRange('F' + String(i+2)).setValue(row[4]);
 }
 }
}

function getYesterdayDate()
{
 var date = new Date();
 var substract = new Date(date.getTime()-1*(24*3600*1000));
 var yesterday = Utilities.formatDate(substract, "GMT+5:30", "yyyy-MM-dd");
 return yesterday;
}

Now, you have to authenticate your google script with adsense to do so