Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd love to show the Google Analytics traffic information for each page on my site EMBEDDED into that page. What's the easiest way to do this?

share|improve this question

closed as off-topic by Sathya Jul 22 '13 at 3:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "It is a question about creating/developing a web application." – Sathya
If this question can be reworded to fit the rules in the help center, please edit the question.

There is no easy way to do it. Since the "flash" charts are not available to embed on to your website.

The only way you could do it is through the Google Analytics API,

See, http://code.google.com/apis/analytics/docs/

But this still won't give you charts. If you wanted charts you could use the Google Charts API in conjunction with the Google Analytics API to make your own.

See, http://code.google.com/apis/chart/

share|improve this answer
Wow, quite crazy that nobody else wanted to do this. I'd imagine that every user-generated-content site that uses Goog Analytics wants to do something like this (expose stats to the user base). Is there some other free Analytics package that can do this easily? Thank you! – Alex Sep 30 '10 at 19:56
You could look into using Mint which has widgets see, haveamint.com/peppermill and haveamint.com/peppermill/widgets – cfaulkingham Sep 30 '10 at 20:05

I actually ran into this same problem myself. I ended up just building my own solution and publishing it for use. OOCharts uses just one script. On top of that, you can present the charts to the public or clients. It uses Google Charts to create the charts. I also included some prebuilt solutions for anyone who doesn't want to touch the javascript objects. Here is a sample embed block for someone who wants a visit line chart:

     <script type="text/javascript" src="http://oocharts.org/release/current/oocharts.js"></script>
     <script type="text/javascript">

     function drawCharts() {
        var end_date = new Date();

        var start_date = new Date();
        start_date.setDate(end_date.getDate() - 30);

        var c = new oochart("ooid", "aid", start_date, end_date, "line");
        c.setMetric('ga:visitors', 'Visits', 'number');
        c.setDimension('ga:date', 'Date', 'date');

            for (var i = 0; i < data.length; i++) { data[i][0] = oo.utility.parseAnalyticsDate(data[i][0]); }
            c.draw("visits_chart", data);
    <div id="visits_chart"></div>

I know this is late to the question, however, this is the article I found when I was looking for answers, and would have appreciated a solution like this (minimal setup, no site registration, customizable).

Edit: The original ".org" solution has been rebuilt into a simplistic API over at oocharts.com.

Edit: Another option which might work for you is superProxy.

share|improve this answer

Google has sample code for this:

Visualizing Google Analytics Data with Google Chart Tools


This article shows you how to take data from the Google Analytics Data Export API and visualize it with a variety of different graph types using the Google Charts API. This particular article is going to focus on doing it in Javascript

share|improve this answer

Check out embeddedanalytics. This is a service precisely for what you are asking. You define the chart (type, metrics, dimensions, date range) and then simply embed a snippet of code into your site where you want the chart to show.

Disclosure: I work with embeddedanalytics

share|improve this answer

Since the OP also asked if there is a similar free analytics package that allows easy embedding of charts and data, it's worth mentioning Piwik.

It's a Free software project and has pretty good documentation on embedding, seems to be exactly what the OP is looking for.

share|improve this answer

Disclaimer: I have no idea how to do this via code.

However, using the 'send email' report, you could send an email with your report as xml/csv/etc attachment on an automated periodic basis to a holding email account that would process it. IE, set Analytics to send the email weekly, set the mail client to automatically take emails from that sender with .xml files and upload the attachment to a holding space you could render a graph from. Then basically you just need a script to render the values from the exported report.

share|improve this answer

At the Google Analytics App gallery, there is a web app called SeeTheStats.

It can pull stats from your account, creates charts based on that data & it supports widgets that you can embed to show those charts on your own site.

share|improve this answer

Try Explainum.

Explainum is the most easiest way to embed a chart from Google Analytics to a site. No sheets, no complicated things to setup.. Explainum connects to the data on Google Analytics, and gives a code to embed a chart to my site. The same way as youtube gives you a code to embed a video on your site.

share|improve this answer
The link leads to a different site at the moment. – Alex Jun 30 '13 at 18:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.