Why am l getting "access not configured" error why trying to make an api call to google analytics reporting?
l am trying to integrate google analytics reporting to a laravel website hosted locally and its giving me this error
{"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."}} ◀"
l have enabled the api in the dashboard and can not seem to solve it.Below is the controller class
namespace AppHttpControllers;
use IlluminateHttpRequest;
use AppModelsOrder;
use AppModelsUser;
use Analytics;
use SpatieAnalyticsPeriod;
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');
}
}
Please any assistance is appreciated
from Laravel Questions and Answers https://laravelquestions.com/php/why-am-l-getting-access-not-configured-error-why-trying-to-make-an-api-call-to-google-analytics-reporting/
via Lzo Media
No comments:
Post a Comment