2

I wanna start using Google Analytics PHP API.

I found 2 libraries and I can't understand which one should I use and what is the main difference between them: gapi-google-analytics-php-interface and google-api-php-client

P.S. The main reason to use this API is requirement to work with goals.

Kara
  • 6,115
  • 16
  • 50
  • 57
Yekver
  • 4,985
  • 7
  • 32
  • 49

2 Answers2

2

google-api-php-client is for Google API's and not specifically for Google Analytics.

gapi-google-analytics-php-interface is a library that connects to your Google Analytics account and extracts data. You should use this client.

GAPI (said 'g,a,p,i') is the Google Analytics PHP5 Interface.

Mihai Iorga
  • 39,330
  • 16
  • 106
  • 107
  • 1
    is GAPI an official API? Coz I can't find any info about this fact and it's last realize was in 2009. – Yekver Oct 09 '12 at 07:18
  • 1
    I don't think is the official API, the official API is the first one, but the second has more already built-in features. – Mihai Iorga Oct 09 '12 at 07:23
0

Would recommend following this tutorial.

Hello Analytics

Although, as I recall, the latest github library did not match the script and I had to find a previous version.

If you get a bunch of include errors, check the folder structure. I ended up downloading the previous version (which matched) and have had no issues using GA API since.

user734063
  • 569
  • 1
  • 5
  • 13