thujohn / analytics-l4 Goto Github PK
View Code? Open in Web Editor NEWGoogle Analytics for Laravel 4
License: MIT License
Google Analytics for Laravel 4
License: MIT License
Im getting this error message
Google_Service_Exception (403)
Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) User does not have any Google Analytics account.
Hi - thanks for your code - I hope you don't mind but I'm trying to modify your code to use the google calendar api. I keep falling at first hurdles! This is not an issue for your code more a plea for help :)
I am using your analytics.php as a start, have set up a workbench in laravel 4 and included your package as a dependancy - I can get your package to work in my workbench.
However in my googlecal.php file (my name for the package) which is almost identical to yours I come up with an error:
Argument 1 passed to Longestdrive\Googlecal\Googlecal::__construct() must be an instance of Google_Client, none given
So I assume it can't create a google_client. My service provider register is identical to yours.
As my project is still in workbench and your package is in the vendor folder does this make any difference to the path I need to specify to google_client? which is currently:
public function __construct(\Google_Client $client) {
$this->setClient($client);
$this->setService($client);
}
Sorry - I'm fairly new to L4 and this is my first attempt at a package so struggling all the way!
Appreciate any tips or pointers please
Hi, after installation, i receive this error when I try to use this package:
Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }'
I've read on StackOverflow about NTP offset, this is my situation when I do ntpd -p:
time1-st1.apple 17.168.198.149 2 u 7 512 1 167.002 -1.008 1275.79
Where -1.008 is my offset.
Any helps?
Any chance of getting Laravel 5 support for this package?
Documentation has been written for Laravel 5 packages.
http://laravel.com/docs/master/packages
i'm using parameters like sort and max-results, but aren't working, my code is below
$site_id = Analytics::getSiteIdByUrl('http://www.wallaroohats.com'); // return something like 'ga:11111111'
$arr = array("max-results" => 10);
$stats = Analytics::query($site_id, '2015-06-01', '2015-06-08', 'ga:sessions', 'ga:source', $arr);
The below is the code in Analytics.php
public function get($ids, $startDate, $endDate, $metrics, $dimensions, $optParams = array())
{
$params = array('ids' => $ids, 'start-date' => $startDate, 'end-date' => $endDate, 'metrics' => $metrics, 'dimensions' => $dimensions);
$params = array_merge($params, $optParams);
return $this->call('get', array($params), "Google_Service_Analytics_GaData");
}
Please help me out
As the subject states. Is there any other way of using the tool other than adding the service email to the user's google analytics account? Thanks in advance.
Hi guys,
there's something weird with this package. I don't know why, but like i as said in the title, the counting visit always indicate 0. Why ?
I added this to composer.json
"thujohn/analytics": "dev-master"
I have this output
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for thujohn/analytics dev-master -> satisfiable by thujohn/analytics[dev-master].
- thujohn/analytics dev-master requires google/apiclient 1.0.*@dev -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Its can't find google/apiclient 1.0.* package.
Hello,
Sometime I problem with AnalyticsServiceProvider, because I get ErrorException in line 33. When I call var_dump in line 33 to check if file exist (key.pl2) it true result. In next step I remove var_dump line and all work well for next 3h. Why I get this error when file key exists?
"log.ERROR: exception 'ErrorException' with message 'file_exists() expects parameter 1 to be a valid path, array given' in /gotarget_oclublin/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php:18 Stack trace: #0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'file_exists() e...', '/gotarget_oclub...', 18, Array) #1 /gotarget_oclublin/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(18): file_exists(Array) #2 /gotarget_oclublin/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(206): Illuminate\Filesystem\Filesystem->exists(Array) #3 /gotarget_oclublin/vendor/thujohn/analytics/src/Thujohn/Analytics/AnalyticsServiceProvider.php(33): Illuminate\Support\Facades\Facade::__callStatic('exists', Array) #4 /gotarget_oclublin/vendor/thujohn/analytics/src/Thujohn/Analytics/AnalyticsServiceProvider.php(33): Illuminate\Support\Facades\File::exists(Array) #5 /gotarget_oclublin/vendor/laravel/framework/src/Illuminate/Container/Container.php(149): Thujohn\Analytics\AnalyticsServiceProvider->Thujohn\Analytics"
hi,
var_dump
Google_Service_Analytics_GaData Object
(
[collection_key:protected] => rows
[internal_gapi_mappings:protected] => Array
(
)
[columnHeadersType:protected] => Google_Service_Analytics_GaDataColumnHeaders
[columnHeadersDataType:protected] => array
[containsSampledData] =>
[dataTableType:protected] => Google_Service_Analytics_GaDataDataTable
[dataTableDataType:protected] =>
[id] => https://www.googleapis.com/analytics/v3/data/ga?ids=ga:xxxxxx&metrics=ga:visits&start-date=7daysAgo&end-date=yesterday
[itemsPerPage] => 1000
[kind] => analytics#gaData
[nextLink] =>
[previousLink] =>
[profileInfoType:protected] => Google_Service_Analytics_GaDataProfileInfo
[profileInfoDataType:protected] =>
[queryType:protected] => Google_Service_Analytics_GaDataQuery
[queryDataType:protected] =>
[rows] =>
[sampleSize] =>
[sampleSpace] =>
[selfLink] => https://www.googleapis.com/analytics/v3/data/ga?ids=ga:xxxxx&metrics=ga:visits&start-date=7daysAgo&end-date=yesterday
[totalResults] => 0
[totalsForAllResults] => Array
(
[ga:visits] => 0
)
[modelData:protected] => Array
(
[query] => Array
(
[start-date] => 7daysAgo
[end-date] => yesterday
[ids] => ga:xxxxx
[metrics] => Array
(
[0] => ga:visits
)
[start-index] => 1
[max-results] => 1000
)
[profileInfo] => Array
(
[profileId] => xxxxx
[accountId] => xxxx
[webPropertyId] => UA-xxxx-1
[internalWebPropertyId] => xxxx
[profileName] => xxx.com
[tableId] => ga:xxxx
)
[columnHeaders] => Array
(
[0] => Array
(
[name] => ga:visits
[columnType] => METRIC
[dataType] => INTEGER
)
)
)
[processed:protected] => Array
(
)
)
When will Laravel 5 support ?
Hi!
Would at request time I specify which client id, email service certificate and I want to use? for more than one use.
Thank you!
I just install the package via composer, and config it with the correct parameters from the google api console.
Route::get('test', function() {
$accounts = Analytics::webproperties()->listManagementWebproperties("~all");
foreach ($accounts as $account){
var_dump($account);
}
});
Navigate to the route displays "This web page is not available" on chrome and "Server not found" on firefox. Am i doing something wrong
Hi! I have the bundle installed on my laravel 4.0 and all the conf is right, but I have an error when I call this route:
ROUTE:
Route::get('/list', function()
{
return print_r(Analytics::webproperties()->listManagementWebproperties("~all"));
});
ERROR:
The Response content must be a string or object implementing __toString(), "boolean" given.
I also try:
ROUTE
Route::get('/list', function()
{
return Analytics::webproperties()->listManagementWebproperties("~all"));
});
ERROR:
The Response content must be a string or object implementing __toString(), "object" given.
Any idea? Thanks
Since the latest commit, I keep getting the following error on composer update
- thujohn/analytics dev-master requires google/apiclient 1.1.* -> no matching package found.
- Installation request for thujohn/analytics dev-master -> satisfiable by thujohn/analytics[dev-master].
I can see that the package required should be satisfied. Not sure why it isn't working though ๐
Have to update composer.json to : "google/apiclient": "dev-master" ?
Thanks :)
I tried to run a composer update and I receive the following error:
[Symfony\Component\Process\Exception\RuntimeException] The process has been signaled with signal "11".
I have removed all other packages and have figured out it has something to do with your package and perhaps a conflict with another package that was updated during the update.
Do you have any idea why that error message would appear and how to fix it?
Hello,
Do you have an example of how to add a filter. I was trying to specify a pagePath. I tried a few different variations including:
$googleData = Analytics::query(
$googleSiteID,
'7daysAgo',
'yesterday',
'ga:sessions,ga:visits,ga:pageviews,ga:pagePath=~/' . $page->ref
);
But had no luck.
Also I noticed you have an optional $other param for the query method. What is that used for?
Thanks for your help.
hi..
i am getting this error
Error calling GET https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles: (403) User does not have any Google Analytics account.
i wonder why this is happening ,as i have a valid google analytic account with
my account info showing on the right/top of my account page as
[email protected]
laraval - http://laraval.eu1.frbit.net/
All Web Site Data
(more over i am putting the client id and mail etc. well attached with my google api account with analytics api enabled)
please help me resolving the error
Does the current package work for Google AdWords as well?! I would like to be able to track ads, campaigns and so on.
Hello.
I'm getting this error:
ErrorException (E_UNKNOWN) fread(): Length parameter must be greater than 0
The origin of the error is from this method call:
Analytics::getSiteIdByUrl($url);
Seems to be because of Google API:
/home/httpd/html/vipmembers.net/yppcmsmembers/vendor/google/apiclient/src/Google/Cache/File.php ); $this->delete($key); return false; } } if ($this->acquireReadLock($storageFile)) { $data = fread($this->fh, filesize($storageFile)); $data = unserialize($data); $this->unlock($storageFile);
Any idea what is causing this? Was working fine then just stopped working all of a sudden.
Would appreciate any help.
Hi,
We got the package working with a Service Account but would like to use the Web Server authorisation to avoid needing to add the service email to each account. Any suggestions ?
I'm wondering if we modify this package or should be looking for a different package ?
Cheers!
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR)
Class 'Class' not found
why
I'm trying to use the example in the README but this is what returns:
Non-static method Thujohn\Analytics\Analytics::getSiteIdByUrl() should not be called statically, assuming $this from incompatible context
Great package, just found a small gotcha when moving to a shared host. The underlying Google code uses a file based cache that can be problematic if you have permissioning issues writing to the default temporary directory.
I worked around it by changing line 139 \vendor\google\apiclient\src\Google\Config.php to fix a location with write access in my hosting environment:
E.G. CHANGE THIS: 'directory' => sys_get_temp_dir() . '/Google_Client'
TO THIS: 'directory' => 'myThang/Google_Client'
Not elegant but I couldn't figure out how to do it via the wrapper. Adding a way to inject config values would be ace.
Thanks again for a great package, and for your Laravel Twitter wrapper - both getting heavy use by me!
I receive this error: 'Class 'Google_AssertionCredentials' not found'. Can anyone explain how I can solve this error?
I was just trying to install the package from composer when the "Your requirements could not be resolved to an installable set of packages." appeared.
It looks like Google removed their api-client rep?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.