ads2 / reporting-api
本包最新版本(v1.0)没有可用的许可证信息。
与AdsSquared的报表服务器通信的工具
v1.0
2020-09-21 13:40 UTC
Requires
- guzzlehttp/guzzle: ^7.0.1
This package is auto-updated.
Last update: 2024-09-26 00:45:59 UTC
README
AdsSquared报表API允许您检索您的AdsSquared账户的各种报表。
安装
composer require ads2/reporting-api
使用
要加载报表,请使用Reporter外观。为每个方法提供所需的参数,并将创建一个报表并返回一个jobID到对象。
一旦有jobID可用,您可以使用fetchReport()方法检索报表。成功检索的报表在报表的CSV属性中可用。
可用的报表
- 设备
- 设备类型
- 源代码
- 源类型
- 设备每小时
- 设备类型每小时
- 源每小时
- 标签
use AdsSquared\Facade\Reporter;
// Instantiate your report object, begin the creation of this report
$device = Reporter::Device('myUsername', 'myAPIKey', 'Jan 1, 2020', 'Jan 30, 2020', 'us', 10000);
// Retrieve the report
$device->fetchReport(); // Returns true if it retrieves the report; false otherwise
// Write the CSV report to a file
$pointer = fopen('JanReport.csv', 'w');
fputcsv($pointer, $device->csv);
fclose($pointer);