我正在为4管理API使用PHP库。但我无法拿到账户清单。然而,我认为这是因为我没有通过auth access_token。但我不知道该怎么做。
require 'vendor/autoload.php';
use Google\Analytics\Admin\V1alpha\AnalyticsAdminServiceClient;
use Google\Analytics\Data\V1beta\BetaAnalyticsDataClient;
use Google\Analytics\Data\V1beta\DateRange;
use Google\Analytics\D
在过去的2-3天里,我试图以某种方式下载“页面和屏幕:页面路径和屏幕类”报告,这样我就可以将数据包含在我的管理系统中。 我尝试在PHP中使用Google Analytics API,下面是一个示例 $analytics = new Google_Service_Analytics($client);
$profileId = ''; // But i cant get the profile id because the Analytics account doesnt have them
$yesterday = $startDate = $endDate = date
这是我的问题。我花了两天的时间在谷歌上测试和搜索这个错误,但我不明白解决这个问题的方法。当我向谷歌提出请求时,谷歌说:
"error" : "invalid_grant"
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De
我试着用Python客户机()从中获取数据。下面是我使用的代码:
from apiclient import discovery
from oauth2client.client import SignedJwtAssertionCredentials
from httplib2 import Http
with open("ManagementGate-622edd43c0dd.p12") as f:
private_key = f.read()
credentials = SignedJwtAssertionCredentials(
'XXXXX
是否有可能从新的(GA4)帐户中通过API V4获得数据?它总是返回以下错误消息:
{ "error": { "code": 403, "message": "User does not have sufficient permissions for this profile.", "errors": [ { "message": "User does not have sufficient permissions for this profile.", "domain
我只想了解如何在php中运行batchRunReports,我尝试了一个示例,但它提供了一个复杂的致命错误消息。我查看了,但没有发现任何与我的问题相关的东西。我可以使用文档中的工具运行我想要的查询,但是我无法将它传递给php。
use Google\Analytics\Data\V1beta\BetaAnalyticsDataClient;
use Google\Analytics\Data\V1beta\DateRange;
use Google\Analytics\Data\V1beta\Dimension;
use Google\Analytics\Data\V1beta\Metric;
似乎没有一种方法可以获得Google Analytics属性的时区,或者有吗? Data API (https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema?hl=en)返回属性时区中的数据,但是为了让我们正确地解释它,我们需要知道属性所在的时区。 有人找到解决办法了吗? 谢谢!
我已经尝试过官方的教程,但是它不起作用。
我收到了这个错误:
"PHP致命错误:未找到类'Google_Auth_AssertionCredentials‘’“
我的代码:
// Creates and returns the Analytics service object.
// Load the Google API PHP Client Library.
require_once 'vendor/autoload.php';
// Use the developers console and replace the valu
我在这个项目中使用了Laravel5.3。我有一个帐户上的谷歌分析api和另一个gmail帐户。我想授予api对第二个gmail帐户的访问权限,并将其添加到用户中。
我有一个凭据json文件,所有代码如下:
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class HomeController extends Controller {
public function index(Request $request)
我试图使用analytics获取一些数据,我的例子是:
function getResults(&$analytics, $profileId) {
// Calls the Core Reporting API and queries for the number of sessions
// for the last seven days.
return $analytics->data_ga->get(
'ga:' . $profileId,
'7daysAgo',
'today',
'ga:sessions
Google Analytics Embed API (https://developers.google.com/analytics/devguides/reporting/embed/v1)是否支持本月刚刚宣布的新GA4属性(https://www.blog.google/products/marketingplatform/analytics/new_google_analytics/)?