My config/analytics.php
<?php
return [
'view_id' => 1111111,
'cache_lifetime_in_minutes' => 60 * 24,
'cache' => [
'store' => 'file',
],
];
What I want to happen is set the view_id
=>
googleApi
at my Controller.
public function showSpecificSite($site_id){
$reports = Report::whereHas('site', function($query) use($site_id) {
$query->where('site_id', $site_id);
})->get(['email_date', 'url', 'recipient', 'report_id', 'site_id']);
$googleApi = DB::table('sites')->where('site_id', $site_id)->value('ga_id');
Config::set('view_id', $googleApi);
$siteName = Site::find($site_id)->site_name;
return view('newsite', compact('site_id', 'siteName', 'reports'));
}
My query
public function showMonthlyReport($site_id, $report_id)
{
$analyticsData = Analytics::performQuery(Period::days(30),
'ga:',
[
'metrics' => 'ga:users,ga:newUsers,ga:sessions,ga:sessionsPerUser,ga:pageviews,ga:pageviewsPerSession,ga:avgSessionDuration,ga:bounceRate',
'start-date' => '2018-08-01',
'end-date' => '2018-08-30',
]);
}
I tried config:set
but it didn't help me at all.
Do you have any idea or thoughts how to fix this?