Custom Google Analytics Dashboard for your PHP Application using GA-API

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.

About these ads

47 Responses to “Custom Google Analytics Dashboard for your PHP Application using GA-API”

  1. jason Says:

    great article, any chance i could get the source?

  2. ambest Says:

    where is the source code….

  3. Amer Trkic Says:

    Great work, where i can find source code?

    Best,
    Amer

  4. Wieger Says:

    Nice topic. Can you’ve send me the code? I want to use it for an app inside MODx.

  5. Combat Shop Tactical Gear Says:

    Can’t find something like this anywhere either.

  6. Thiago Otaviani Vidal Says:

    Hey dude. nice topic. may i have the code?

  7. kym Says:

    bummer
    was really looking for this
    cant find it anywhere…

  8. Oki N Says:

    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.

  9. David Says:

    Nice post! I love to have code. Thx!

  10. PHP Spider Says:

    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.

  11. PHP Spider Says:

    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.

  12. Jos Gerrits Says:

    Can i have a copy of this aswel please! :) thx in advance.

  13. Dhana Says:

    Can i get the code for this pls?

  14. Chris Says:

    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..

  15. Kyle Says:

    I would love to have a copy of this! i need to implement it into my site. This is AMAZING!

  16. Andy Says:

    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

  17. Oki N Says:

    Superb!!

    I’d like to see how you retrieve the XML.
    Please kindly send me the source code.

    Thanks.
    Regards
    Oki

  18. Mark Says:

    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

  19. Chris Says:

    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.

  20. bidou Says:

    Hi,
    Good work.
    Can you plz share your code?!

    Thanks a lot

  21. Robert Says:

    Really interested in how you’ve put this together. Can you send me the source please?

    Many thanks

    Rob

  22. Roger Says:

    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

  23. sreeju Says:

    Can you please send me the source code?
    Thank you very much!!! Its really very interesting

  24. Laurent Says:

    Hi !

    Your work seems very interesting !

    Could you send me your sample code please ?

    Thanks,

    Laurent

  25. Artificial Colours Design Says:

    Looks like a awesome library would be be intested in receiving the source code! Thanks!

  26. Frans Says:

    Hi sounds good,

    Could you please send the source code?

    Thanks a lot,

    Frans Erich

  27. Fredrik Starke Says:

    Looks like Ive found a part of the solution to my puzzle. Please mail me the sample. :)

    Thank you.

  28. Koen Steenhout Says:

    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.

  29. Sreeju PK Says:

    This is exactly what I was looking for! I would love to see your sample code.

    Thanks

  30. avijit paul Says:

    Can you please send me the source code?
    Thank you very much!!! Its really very interesting

  31. Pedja Says:

    Hi, I am interested to tryout your code.

  32. Arjan Says:

    Can you please send me the source code?
    Thank you very much!!!

  33. Brandon Shaw Says:

    This is exactly what I was looking for! I would love to see your sample code.

    Thanks

  34. Chad Says:

    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!

  35. Marcelo Barros Says:

    Please Azghanvi share the sample code with us!
    :)

  36. kim Says:

    Nice work!

    Can you send me the sample code?
    Thanks

  37. suba Says:

    Hai, I need to integrate analytics stats in my dashboard. is it possible to get a code?
    Thanks,
    Suba

  38. Mitja Says:

    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

  39. Marcelo Barros Says:

    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?

  40. SEO Pakistan Says:

    From a research i heard tht it has certain limit of 50,000 Views only! is that true

  41. Chris Says:

    could you email me the sample code please? i would like to integrate this with my admin panel as well.

    awesome idea btw!

  42. Patrick Leddy Says:

    Lovely implementation we have been looking for something like this for ages for our corporate intranet – any chance I could get a copy? Cheers

  43. Gazler Says:

    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!

  44. Sérgio Paulino Says:

    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!

  45. haris Says:

    great work Afnan bhai, keep it up!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 28 other followers

%d bloggers like this: