Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as JavaScript by Seomih ( 9 years ago )
function main() {
// Загрузка всех дочерних аккаунтов.
var accountIterator = MccApp.accounts().get();
// Выполнение итерации по списку аккаунтов.
while (accountIterator.hasNext()) {
var account = accountIterator.next();
// Создание статистики по дочернему аккаунту.
var cur = account.getCurrencyCode();
var stats = account.getStatsFor("TODAY"); //YESTERDAY
// Регистрация действия.
//Logger.log("%s,%s,%s,%s,%s,%s,%s", "Profit Lead", account.getName(), account.getCustomerId(), stats.getClicks(), stats.getImpressions(), stats.getCost(), cur);
var res = {
mccname: "RitaBiz",
accname: account.getName(),
accid: account.getCustomerId(),
clicks: stats.getClicks(),
imps: stats.getImpressions(),
cost: stats.getCost(),
cur: cur
};
//Logger.log(res);
var formData = res;
// Because payload is a JavaScript object, it will be interpreted as
// as form data. (No need to specify contentType; it will automatically
// default to either 'application/x-www-form-urlencoded'
// or 'multipart/form-data')
var options = {
'method' : 'post',
'payload' : formData
};
var resp = UrlFetchApp.fetch('http://shop4you.pw/mainadmin/adwords/getstat_online.php', options);
Logger.log(resp);
}
}
Revise this Paste