Christoffer
Christoffer

Reputation: 492

Export Google Analytics chart for specific URL

I would like to show a graph of visitors (eg. 7 days back) on a specific subpage on my website - not the entire site!

I've been looking at: http://www.jensbits.com/2010/06/23/google-analytics-data-export-api-with-google-chart-visualizations-2/

.. but i cant figure out how to show a graph for a specific url/subpage.

Any ideas?

Upvotes: 2

Views: 1830

Answers (1)

jmishra
jmishra

Reputation: 2081

Follow these steps

1.Go to your Google Analytics Account.

2.Click on the 'gear' icon. It will show you 3 tabs-> Profile, Tracking Code and Property Settings. Click on Tracking Code.

  1. Under What are you tracking? select A Single Domain radio button. It will show you its corresponding options on the right. Select I want to track PHP pages. It will show you the tracking code underneath. Copy paste the code in the php file/page you are willing to track.

    Dont worry about the query parameters. They will be identified automatically with respect to the tracking code. So if your page identifies 100 different layouts with respect to the parameters, they will show up in your analytics account.

Use the following Api to export data from your account

Google Analytics PHP API

Then, after you have received the data, you can set up an ajax request that fetches the data from your PHP script and embeds it in your site using a javascript API chart builder. This is also available with Google

Google Charts API

Hope that helps. All the best!

Upvotes: 2

Related Questions