Я пытаюсь интегрировать отчеты Google Analytics в локальный веб-сайт laravel, и это дает мне эту ошибку.
{"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Access Not Configured. Google Analytics API has not been used in project 463423597673 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analytics.googleapis.com/overview?project=463423597673 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.","extendedHelp":"https://console.developers.google.com/apis/api/analytics.googleapis.com/overview?project=463423597673"}],"code":403,"message":"Access Not Configured. Google Analytics API has not been used in project 463423597673 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analytics.googleapis.com/overview?project=463423597673 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."}} ◀"
Я включил API в приборной панели и не могу решить его. Ниже приведен класс контроллера
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Order;
use App\Models\User;
use Analytics;
use Spatie\Analytics\Period;
class AdminDashboardController extends Controller
{
//
public function __construct(){
$this->middleware('auth');
}
public function create(){
$analyticsData = Analytics::fetchVisitorsAndPageViews(Period::days(7));
$orders = Order::limit(5)->get();
$users = User::limit(5)->get();
return view('admin.admin-dashboard',compact('orders','users'));
}
public function destroy(){
auth()->logout();
return redirect('/admin');
}
}
Пожалуйста, любая помощь приветствуется
Задача ещё не решена.
Других решений пока нет …