thujohn / analytics-l4

Google Analytics for Laravel 4
MIT License
111 stars 33 forks source link

Support for Web Sever access ? #27

Open crisp-github opened 10 years ago

crisp-github commented 10 years ago

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!

thujohn commented 10 years ago

Hi.

I made this package to simply create an app and not manage authorizations after.

I didn't check other packages but you can modify this. And if you want you make a PR after.

crisp-github commented 9 years ago

Hi thujohn ,we did modify the package to use web server authorisation. But we assume the refresh token is set in advance. It is not in a state for a PR unfortunately. But if someone wants some pointers I can help.

rayne128 commented 9 years ago

Hello crisp, im very interested on your approach. Mind sharing your how did you achieve it? Thanks

crisp-github commented 9 years ago

Hi, sure. We modified AnalyticsServiceProvider.php In our set we use a patch to modify the file in the vendor directory. Just modify the register() method for how $client is created. The main bit of code is:

You can see we added a class variable $credentials and set that in the register function by pulling the credentials form our DB. You could hardcode the value there to get started.

rayne128 commented 9 years ago

Thanks for the help! The code snippet you provided is enough to get me started. Thanks again really appreciate it.