1
votes

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.

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

1
leaving this link for people interested on how to use the BQ + AdSense integration: developers.google.com/adsense/bigquery - Felipe Hoffa

1 Answers

0
votes

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?