使用 Adsense Management API 从特定 URL 获取总收入 [英] Get the total earnings from a specific URL using the Adsense Management API
问题描述
是否可以获取特定网址的总收入(例如,https://example.com/page/xyz) 使用 AdSense Management API?(最好是 PHP 库).
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? (preferably the PHP library).
如果是这样,请发布代码答案或至少一个如何实现的概念.
If so, please post a code answer or atleast a concept of how it could be implemented.
顺便说一句,广告单元或任何特定广告单元的数量无关紧要;我只想要使用 API 的网站上特定 URL 的总收入
推荐答案
您可以使用 URL Channels 声明您要跟踪的特定页面,然后在 API 中您可以在报告中包含 URL_CHANNEL_ID 或 URL_CHANNEL_NAME 维度以按 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.
设置您的网址渠道后,您可以查看 AdSense API 示例代码库 查看如何运行报告.对于不同的 PHP 版本,此存储库具有不同的文件夹.选择与您的版本对应的文件夹,然后转到 examples/GenerateReport.php
作为起点.AdSense API 文档包含维度和指标以及
Once your URL Channels are set up, you can check out the AdSense API example repository to see how to run a report. This repository has different folders for different PHP versions. Choose the folder corresponding to your version, then go to examples/GenerateReport.php
for a starting point. 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 Management API 从特定 URL 获取总收入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!