I'm starting a Laravel site and decided to include the Google Analytics package here https://github.com/thujohn/analytics-l4
After configuring it properly with my credentials and placing the .p12 file, I tried this:
<?php $site_id = Analytics::getSiteIdByUrl('http://example.com');
$stats = Analytics::query($site_id, '7daysAgo', 'yesterday', 'ga:visits,ga:pageviews');
echo $stats;
?>
It's close, but then it hits an open_basedir error. Here is the error code:
ErrorException (E_UNKNOWN) file_exists(): open_basedir restriction in effect. File(/tmp/Google_Client/e4/e4376171b3c41df2c55e1a689f6386c9) is not within the allowed path(s): (/var/zpanel/hostdata/zadmin/public_html/:/var/zpanel/temp/)
You can see that path is way wrong. Not sure where to correct that. Not sure what else to do. Any help is appreciated. Thanks