Adam Ramadhan
Adam Ramadhan

Reputation: 22820

how to read google analytics api?

ok lets say we have a return like

  0 => 
    object(gapiReportEntry)[7]
      private 'metrics' => 
        array
          'pageviews' => int 1
          'uniquePageviews' => int 1
      private 'dimensions' => 
        array
          'visitCount' => string '61' (length=2)
          'source' => string '(direct)' (length=8)
          'city' => string 'Jakarta' (length=7)
          'pagePath' => string '/netcoid' (length=8)
          'date' => string '20110511' (length=8)
  1 => 
    object(gapiReportEntry)[12]
      private 'metrics' => 
        array
          'pageviews' => int 1
          'uniquePageviews' => int 1
      private 'dimensions' => 
        array
          'visitCount' => string '68' (length=2)
          'source' => string 'github.com' (length=10)
          'city' => string 'Jakarta' (length=7)
          'pagePath' => string '/netcoid' (length=8)
          'date' => string '20110511' (length=8)
  2 => 
    object(gapiReportEntry)[8]
      private 'metrics' => 
        array
          'pageviews' => int 31
          'uniquePageviews' => int 1
      private 'dimensions' => 
        array
          'visitCount' => string '57' (length=2)
          'source' => string '(direct)' (length=8)
          'city' => string 'Jakarta' (length=7)
          'pagePath' => string '/netcoid' (length=8)
          'date' => string '20110510' (length=8)

i assume that i can read it like this,

0 = >

ok. lets say i can explain it.

question is

1.how can we explain exactly what is going on ? how do you read this ?

2.what is diffrence between metrics and dimensions ?

Upvotes: 0

Views: 203

Answers (1)

Ewan Heming
Ewan Heming

Reputation: 4648

A dimension is an attribute of something you're reporting on. A metric is a statistic that relates to the attribute. For example, in a report that shows pageviews for each referral source broken down by date, source and date are dimensions and pageviews is the metric.

If you're familiar with SQL you can think of it in terms of dimensions being what goes in the GROUP BY clause while metrics are the calculations that go into the aggregation functions such as SUM.

The extract you have from the GA API is showing you the pageviews and uniquePageviews that relate to each grouping of visitCount, source, city, pagePath and date.

Upvotes: 1

Related Questions