I get the error "Unexpected. Please try again." while accessing adsense reports through Google Api. Executing the below query in BigQuery browser tool works like a charm. Note: I use the server2server authentication.
我收到错误“意外。请再试一次。”通过Google Api访问adsense报告时。在BigQuery浏览器工具中执行以下查询就像一个魅力。注意:我使用server2server身份验证。
SELECT date, SUM(earnings) FROM [google.com:adsense-reports:Reports.DailyReport] GROUP BY date
To ensure my code is correct I run this query and it worked:
为了确保我的代码是正确的,我运行此查询并且它有效:
select word from [publicdata:samples.shakespeare] where word="sleep"
Now I am wondering what's wrong with my approach or what am I missing?
现在我想知道我的方法有什么问题或者我错过了什么?
One of the failing jobs:
失败的工作之一:
job_034df770bf77401d91613240a4cfb0f6
Thanks in advance!
提前致谢!
EDIT: the script uses php
编辑:脚本使用PHP
1 个解决方案
#1
0
You need to access the AdSense BigQuery tables as a user that is active on your AdSense account - this is not what happens when you use the server2server authentication. Can you use a different type of authentication?
您需要以在AdSense帐户中处于有效状态的用户身份访问AdSense BigQuery表格 - 这不是您使用server2server身份验证时发生的情况。你可以使用不同类型的身份验证吗?
#1
0
You need to access the AdSense BigQuery tables as a user that is active on your AdSense account - this is not what happens when you use the server2server authentication. Can you use a different type of authentication?
您需要以在AdSense帐户中处于有效状态的用户身份访问AdSense BigQuery表格 - 这不是您使用server2server身份验证时发生的情况。你可以使用不同类型的身份验证吗?