简体   繁体   English

使用 Adsense 管理 API 从特定 URL 获取总收入

[英]Get the total earnings from a specific URL using the Adsense Management API

Is it possible to get the total all-time earnings of a specific URL (say, https://example.com/page/xyz ) using the AdSense Management API?是否可以使用 AdSense 管理 ZDB974238714CA8DE634A7CE1D083A14ZF 获得特定 URL(例如https://example.com/page/xyz )的总收入? (preferably the PHP library). (最好是 PHP 库)。

If so, please post a code answer or atleast a concept of how it could be implemented.如果是这样,请发布一个代码答案或至少一个如何实现它的概念。

BTW, the number of ad units or any specific ad units dont matter;顺便说一句,广告单元的数量或任何特定的广告单元都无关紧要; I just want the total income from a specific URL on my site using the API我只想使用 API 在我的网站上从特定 URL 获得总收入

You can use URL Channels to declare the specific pages you want to track, and then in the API you can include the URL_CHANNEL_ID or URL_CHANNEL_NAME dimension in your report to break down by URL.您可以使用URL 频道来声明您要跟踪的特定页面,然后在 API 中,您可以在报告中包含 URL_CHANNEL_ID 或 URL_CHANNEL_NAME 维度以按 ZE6B3031A28D2C65D4579A 进行细分。

Once your URL Channels are set up, you can check out the AdSense API example repository to see how to run a report.设置 URL 渠道后,您可以查看AdSense API 示例存储库,了解如何生成报告。 This repository has different folders for different PHP versions.这个存储库有不同的文件夹,用于不同的 PHP 版本。 Choose the folder corresponding to your version, then go to examples/GenerateReport.php for a starting point.选择与您的版本对应的文件夹,然后选择 go 到examples/GenerateReport.php作为起点。 The AdSense API docs have a full list of Dimensions and Metrics and the full report specification in case you want to make other changes. AdSense API 文档包含维度和指标的完整列表以及完整的报告规范,以备您进行其他更改时使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM