12

I'm trying to use google analytics API to retrieve some data to build a chart that displays number of visitor per day for current month.

However I'm almost completely lost with metrics and dimensions idea.

if I use ga:visitors metrics - that would only give me a total number of visitors - right? How would I retrieve visitors per each day in a month?

any advice would be greatly appreciated.

Thanks!

Stann
  • 12,029
  • 18
  • 60
  • 72

1 Answers1

35

I highly recommend using the Data Feed Query Explorer to get your feet wet:

https://ga-dev-tools.appspot.com/query-explorer/

You'll have to login with your Google Account and click the button to grant the application access. But it has a simple UI that lets you build your request. A good starting example might be:

  • dimensions: ga:date
  • metrics: ga:pageviews,ga:visitors

This will give you pageviews and visitors per day, for every day in your date range.

The general idea is that you are building a table of sorts. Metrics are what you are measuring, and Dimensions are what you are grouping the Metrics by.

dana
  • 14,964
  • 4
  • 53
  • 82
  • Thanks for the helpful answer. I tried it but its returning the values only for one metric say ga:pageviews and I am not getting the results for ga.visitors. Any idea? – Beniston Mar 13 '13 at 07:09
  • Wouldn't the metric "visitorsCount" be relevant in this context? Nice tip! – WhoAmI Mar 07 '14 at 08:24