The sample code for the Google Client API pages has been updated. It now uses the names of the new Google Client PHP API release and also switched from object – reference to arrays. Finally the source code is available … Continue reading
Have you ever tried getting some data out of Google Analytics with PHP? This can be complicated. We provide some tutorials how this can be done easily with the official Google Client API and PHP.
This page provides some code for the Google Client API (PHP version), especially with Google Apps for Business accounts. Now it is easy to access information from Google services as Google Analytics or Google Adsense with a PHP script – when interacting with a user but also without e.g. running a cron script.
Available ressources and articles
- Accessing Google data with PHP and Google Client API
- Accessing Google Adsense data with PHP
- Download sample code
- Google API Client Library for PHP: download this now, you’ll need this
- Good tutorial for accessing Google Analytics API data
- Google API console: control the access to the apis, necessary to create new applications
- Manual for Google Analytics API: background information, available api calls and parameters
- Google Analytics API explorer: try and play with the API for Google Analytics without any PHP code, nice and good for debugging and trying
enarion.net released a widget to display the revenues from Google Adsense in your Geckoboard.
All you have to do is to install the widget code (php-based) on your webserver and add a new custom widget to your Geckoboard widget. Various timespans (including today, yesterday, current month, last month) and values (e.g. ecpm, earnings and clicks) can be selected. Values are extracted in realtime from the Google Adsense account, providing up to the minute information.
The code is released under the GPL license and can be used and modified without charge.
Further information and the download can be found at http://enarion.net/tools/geckoboard-adsense-widget/.
You can create, run and share dashboards showing various key / performance values using the webservice Geckoboard. The setup is easy, there are many predefined widgets for various web services including Google Analytics, ZenDesktop, Mailchimp and various more.
Providing open source tools and development knowledge to the public is the aim of enarion.net. It was founded by Tobias Kluge as home of phpSitemapNG years ago, a tool to generate Google sitemaps.
There is now an easy way to see the current revenues from Google Adsense in your Geckoboard dashboard – in realtime (only depending on the update frequency of Google Adsense).