AdWords API 获取费用
我正在寻找一种简单的解决方案,通过 API 从 Google AdWords 中提取每日费用。我查看了 Apility 和官方 AdWords API,但是第一个不再维护,而第二个则太过分了 - 我的意思是 76MB 未压缩代码只能获得日常成本?
有人知道从 Google AdWords 获取费用的简单解决方案吗?
I am looking for a simple solution to extract daily costs from Google AdWords via the API. I've looked at Apility and the official AdWords API, but the first is not maintained any more while the second is an overkill - I mean 76MB of uncompressed code to only get the daily costs?
Does anybody know of a simple solution to get the costs from Google AdWords?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您指的是 API 费用,请参阅 AdWords API 中使用的 GetUnits 调用教程。
如果您指的是运行广告系列费用,则可以使用 统计选择器。您将需要成本/微量。
If you're referring to API costs, there's the GetUnits call, used in the AdWords API Tutorial.
If you're referring to running campaign costs, you can use a StatsSelector. You will want the cost/microAmount.
使用
Laravel 5.8 Google Ads 脚本
v201809
Use
Script for Laravel 5.8
Google Ads v201809
您不应该使用 APILity,因为它支持的 API 版本几年前就已被贬值。该项目被叫停,取而代之的是新的官方 PHP AdWords API 库。它的某些功能仍然有效(例如 AdWords 报告服务),但这种情况不会持续太久。
如果可能的话,我建议使用官方库,因为它使开发和升级变得更加简单,但如果您确实需要更轻的占用空间,您可以尝试使用标准 PHP Soap 扩展自己构建 API 调用。
You shouldn't use APILity as the API version it supports was depreciated several years ago. The project was halted in favour of the new official PHP AdWords API Library. Some functions of it still work (such as the AdWords Reporting Service) but that won't last for too long now.
I would recommend using the official library if possible because it makes development and upgrading so much simpler but if you really need a lighter footprint you can try constructing the API calls yourself using the standard PHP Soap extension.
我建议使用 AdWords 脚本,https://developers.google.com/adwords/scripts/。直接在 AdWords 用户界面中编写 Javascript,可以很好地处理基本内容。
I'd recommend AdWords Scripts, https://developers.google.com/adwords/scripts/. Write Javascript directly in AdWords UI, handles basic stuff pretty well.