Question

I wish to develop a php script in order to export some daily data of a Google Analytics account in a separate database through API. This script must run daily, called with a cron job.

I see that I need to make a manual connect to gather data from google analytics. Is there a way to automate the login, without doing it manually?

Thanks in advance. Luca

Was it helpful?

Solution

You can do this with a service account Service Account

Also make sure you use the new client lib found here: google-api-php-client. The one linked on the service account page is the older version. There should also be some samples in the github project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top