Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP class for use with Google Analytics API

I want to find a PHP class or framework to get data from the Google Analytics API.

I've already used gapi, which is great but it has never been updated since 2009 and it lacks new features from the API such as segments.

Can you please share the classes you've used and their key features ?

Thank you

like image 382
MaxiWheat Avatar asked Dec 22 '25 06:12

MaxiWheat


1 Answers

Edit: I did find an experimental implementation of segments in issue 28 for the repository.

You mentioned gapi already but it seems to be the standard as far as a PHP library for Google Analytics goes. You may find fresher classes on GitHub with your needed functionality.

I took a look around and it seems that your best option is to fork an existing class such as gapi and add the functionality to it which is not what you wanted to hear. I recommend taking a look around at the Google supported libraries for clues on how they implemented the features you want.

This is a good opportunity for you to contribute to an open-source project. Even though this code was last changed in 2009, it's fairly short and can be easily customized to do what you want as long as the corresponding API functionality is there.

Try using the Query Explorer to see what's available. It looks like it will help you build segment queries too.

like image 95
Jason Rikard Avatar answered Dec 23 '25 20:12

Jason Rikard