php - Google Analytics Data Export API V3
I am trying to get to grips with interacting with the GA API v3 using php. Being quite new to php, I am struggling somewhat. Does anyone here have any experience with using the api with php (v3)?
Google does supply a small sample script but it's effectively useless (with my limited skills) as it returns an api key but doesn't tell you where it needs to go or why you need it.
If anyone has any knowledge I would be very grateful if you could show me how.
You need to make sure you register you API with Google from their API console. Make sure you turn on Google Analytics, and create a project.
After make sure you download the full api from Google Code.
You want to go into simple.php located in the Analytics folder (under examples) and uncomment lines 11-14, and replace with information from Google API Console:
This will let you connect and you will see the basic data. For more details and a great tutorial you can see it here.
Your total page should look like this: