Php – How to connect a PHP backend to Google Analytics API

google analyticsgoogle-api-php-clientPHP

I am trying to present some basic data from our Google Analytics accounts directly on our company's backend. I am using the Google API PHP Client.

I have followed the Hello Analytics API tutorial but it leaves me with the obligation to connect from a browser. I need the info to be available from the server itself (without browser client connection) as I would like to automate the queries from within a Cron task.

Is what I want to do possible? Am I using the correct PHP API? Is there a different way to get back GA data?

Best Answer

Why won't you replace your google analytics service with something like Piwik!