Few days back, i was building an executive dashboard using google analytics api. So i wrote a library, by which you can have required google analytics graph/charts inside your Corporate PHP application without going to google analytics page (avoiding 2 admin interfaces). You can embed any desired graph/charts (by providing desired URL) in your corporate website’s admin area.
Using few existing open-source tools, i tried to give same user experience as we have in google analytics dashboard panel. I have used Open Flash Charts for analytics like charts generation and data is fetched from google analytics (thanks to wordpress google analytics plugin).
Actual google analytics charts (image below) are almost similar to what is available in this lib.
Implementation is shown in working sample code which is available to download. You can enhance it as per your requirement.
In configuration file (config.php), you have to provide your Google Analytics User, Google Analytics Password and Profile ID. These information are required by google analytics api for authentication and analytics data fetching. You can get your profile ID from URL (as in image) when you log into your google analytics account.
Click here to download sample code. To download sample code, contact me by replying this post.
Update: Code is grounded due to stability / other issue. Apologies for all followers of this thread. Use this link as an alternate.




September 22, 2012 at 2:28 am
great article, any chance i could get the source?
September 19, 2012 at 1:13 pm
where is the source code….
April 4, 2012 at 2:04 pm
Great work, where i can find source code?
Best,
Amer
June 8, 2011 at 8:04 am
Nice topic. Can you’ve send me the code? I want to use it for an app inside MODx.
February 13, 2011 at 11:48 pm
Can’t find something like this anywhere either.
February 2, 2011 at 6:43 pm
Hey dude. nice topic. may i have the code?
January 18, 2011 at 4:29 am
bummer
was really looking for this
cant find it anywhere…
January 18, 2011 at 2:53 am
I think It’s a hoax article.
I had been waiting for the code, until I had finished my GA code on my own and integrated it myself.
Don’t waste your time guys.
January 18, 2011 at 4:14 am
Update: Code is grounded due to stability / other issue. Apologies for all followers of this thread.
Use this link as an alternate.
http://code.google.com/apis/analytics/docs/articles/gdataAnalyticsCharts.html
January 15, 2011 at 8:30 pm
Nice post! I love to have code. Thx!
January 12, 2011 at 5:24 am
Hello sir,
Greetings for a day.
I want to implement google dashboard in my application. So can u pls give me url or any reference to download sample code for google dashboard for my PHP based web application.
Thanks & regards,
PHP Spider.
January 12, 2011 at 5:21 am
Hello Sir,
Greetings for a day.
I want to implement google charts in my application, so can u pls give me link or any reference to download sample code for google charts code for PHP based application.
Thanks and regards,
PHP Spider.
January 10, 2011 at 6:54 pm
Can i have a copy of this aswel please!
thx in advance.
January 3, 2011 at 3:30 pm
Can i get the code for this pls?
December 20, 2010 at 4:41 pm
Has anyone received the sample code for this? Have been waiting for quite some time. Every week or two I get another notification email that someone else has commented on this thread..still no sample code..
December 18, 2010 at 6:12 pm
I would love to have a copy of this! i need to implement it into my site. This is AMAZING!
December 16, 2010 at 11:22 pm
Hi.. I am a developer in need to build something similar. Looks like you have done most of the stuff. I like open flash charts, so i think this will be perfect.
Your output looks almost exactly like the Google Analytics charts. Great job!
Can you share the source and sample code if any..
thanks a lot
Andy
December 14, 2010 at 4:09 pm
Superb!!
I’d like to see how you retrieve the XML.
Please kindly send me the source code.
Thanks.
Regards
Oki
December 3, 2010 at 11:36 am
Interesting. Would love to see your source once and play around with it. I’m curious how you handle google’s XML in particular.
Kind regards,
Mark
November 23, 2010 at 11:57 pm
I would love to have a copy of your source code. I’m very interested in building a custom dashboard to run on an independent box, and your code would be an amazing starting point.
Thanks so much, I look forward to hearing from you.
November 23, 2010 at 8:38 pm
Hi,
Good work.
Can you plz share your code?!
Thanks a lot
November 22, 2010 at 7:24 pm
Really interested in how you’ve put this together. Can you send me the source please?
Many thanks
Rob
November 21, 2010 at 3:58 am
I am very interested in your implementation. I would like to add something like this to my shopping cart admin dashboard. Would you send the files to me.
thanks
November 13, 2010 at 4:53 pm
Can you please send me the source code?
Thank you very much!!! Its really very interesting
November 12, 2010 at 3:54 pm
Hi !
Your work seems very interesting !
Could you send me your sample code please ?
Thanks,
Laurent
November 12, 2010 at 2:42 pm
Looks like a awesome library would be be intested in receiving the source code! Thanks!
November 1, 2010 at 10:19 am
Hi sounds good,
Could you please send the source code?
Thanks a lot,
Frans Erich
October 31, 2010 at 4:07 pm
Looks like Ive found a part of the solution to my puzzle. Please mail me the sample.
Thank you.
October 28, 2010 at 12:48 pm
Hi,
Nice going,
this is exactly what i’ve been trying to achieve (but failed a little bit).
Can you send me the source code you use for achieving this “beauty” ?
Nice work.
October 27, 2010 at 4:36 am
This is exactly what I was looking for! I would love to see your sample code.
Thanks
October 26, 2010 at 5:06 am
Can you please send me the source code?
Thank you very much!!! Its really very interesting
October 22, 2010 at 2:39 pm
Hi, I am interested to tryout your code.
October 20, 2010 at 1:52 am
Can you please send me the source code?
Thank you very much!!!
October 19, 2010 at 3:45 pm
This is exactly what I was looking for! I would love to see your sample code.
Thanks
October 14, 2010 at 8:46 pm
Hello Azghanvi! Fantastic idea. I’d love to try integrating some charts into my project. Can you send source code? Thanks! Can’t wait to hear from you!
October 11, 2010 at 6:25 pm
Please Azghanvi share the sample code with us!
October 9, 2010 at 7:15 pm
Nice work!
Can you send me the sample code?
Thanks
October 5, 2010 at 8:40 am
Hai, I need to integrate analytics stats in my dashboard. is it possible to get a code?
Thanks,
Suba
October 4, 2010 at 7:17 am
Heya,
im am exploring ways to fetch GA data for custom reports too and would greaty appriciate if you could share the code.
Best regards,
Mitja
October 2, 2010 at 6:00 pm
Azghanvi,
I want to show Google Analytics data to my clients in a custom CMS (that I created) and after searching, I found your solution and it interested me too! Could you email me the sample code?
September 29, 2010 at 9:19 pm
From a research i heard tht it has certain limit of 50,000 Views only! is that true
September 15, 2010 at 10:21 pm
could you email me the sample code please? i would like to integrate this with my admin panel as well.
awesome idea btw!
September 14, 2010 at 8:00 pm
Lovely implementation we have been looking for something like this for ages for our corporate intranet – any chance I could get a copy? Cheers
September 1, 2010 at 3:32 pm
Hi,
I find this post very interesting and would appreciate seeing the source code as I am looking to implement something similar and this could save me weeks of work!
August 25, 2010 at 9:06 am
Great work!
I’m really interested in this, since I’ve beemn trying to integrate GA with my CMS for ages and haven’t found a way yet. Do you think you could send me the sample code please?
Most obliged!
July 7, 2010 at 10:44 am
great work Afnan bhai, keep it up!
November 3, 2010 at 5:48 pm
Hi, I’m really interested in this. could you please send it to me. appreciate it.