我想使用NodeJS服务器使用实时报告API从Google Analytic(分析)中获取我网站上的当前用户:
到目前为止,我尝试通过带有request和gtoken的HTTP请求来执行此操作。 getToken-Part有效。我得到一个令牌。但是HTTP请求不起作用。我收到代码401的“无效凭据”错误。
有人知道该怎么做吗?也许这是获取这些数据的完全错误的方法。
do date=start_date to end_date;
spend = total_spend/(end_date-start_date+1);
答案 0 :(得分:0)
我发现了错误:-)
在授权标题中,“ Bearer”丢失了,它现在就像魅力一样工作,我从Google Real Time API接收数据。
02-02 12:59:33.030 16495-16495/com.example.root.exercicis I/here: v����������������������aaaagt
02-02 12:59:33.030 16495-16495/com.example.root.exercicis I/here: v����������������������aaaag