GA Konferenz-2011 Nick Mihailovski_API

57
Google Analytics Becoming More Productive Using The Analytics API Nick Mihailovski Sr. Developer Programs Engineer Google Analytics

description

How to extend Google Analytics by using the API including award winning 3rd party tools.

Transcript of GA Konferenz-2011 Nick Mihailovski_API

Page 1: GA Konferenz-2011 Nick Mihailovski_API

Google AnalyticsBecoming More Productive Using The Analytics API

Nick MihailovskiSr. Developer Programs Engineer

Google Analytics

Page 2: GA Konferenz-2011 Nick Mihailovski_API

Web Analytics TV

Page 3: GA Konferenz-2011 Nick Mihailovski_API

Agenda

What is the API & Why It’s Important

3 Awesome Tools

Advanced Data Uses

1

2

3

Page 4: GA Konferenz-2011 Nick Mihailovski_API

Agenda

What is the API & Why It’s Important

3 Awesome Tools

Advanced Data Uses

1

2

3

Page 5: GA Konferenz-2011 Nick Mihailovski_API

Developer Platform Overview

Account Configuration

Tracking Code Reports

Processing

Page 6: GA Konferenz-2011 Nick Mihailovski_API

Developer Platform Overview

Management API

ga.js / Mobile SDK Data Export API

Processing

Page 7: GA Konferenz-2011 Nick Mihailovski_API

How the Web Interface works

HTTP Request

Processing

HTTP Response

Page 8: GA Konferenz-2011 Nick Mihailovski_API

How the API works

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,

ga:transactionRevenue

API Query

HTTP Request

Processing

HTTP ResponseXML Response<feed>

<entry><dxp:dimension name='ga:source' value='blogger.com'/ ><dxp:dimension name='ga:medium' value='referral'/><dxp:metric name='ga:visits' type='integer' value='6 8140'/><dxp:metric name='ga:bounces' type='integer' value=' 61095'/>

</entry><entry>

<dxp:dimension name='ga:source' value=’google.com'/><dxp:dimension name='ga:medium' value=’organic'/><dxp:metric name='ga:visits' type='integer' value=‘5 4140'/><dxp:metric name='ga:bounces' type='integer' value=‘ 48095'/>

</entry></feed>

Page 9: GA Konferenz-2011 Nick Mihailovski_API

Retrieving Data From The API

Filters

Date Range

Sort

Profile

Advanced Segments

Dimensions Metrics

Start IndexMax Results

Page 10: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

Page 11: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,ga:transactions,

ga:transactionRevenue

Profile ID: Defines the Google Analytics profile

Page 12: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,ga:transactions,

ga:transactionRevenue

Date Range: Get data from the month of October

Page 13: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions =ga:source # Can specify up

to 7

&metrics= ga:visits ,&metrics= ga:visits ,

ga:transactions,

ga:transactionRevenue

Dimension: Show all the sources of traffic

Page 14: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics =ga:visits, # Can

specify up to 10specify up to 10

ga:transactions,

ga:transactionRevenue

Metrics: The sum of these values across all visits to a site

Page 15: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&start-index=1,

&max-results=10000

Start Index: Starting row numberMax Results: The number of results to return

Page 16: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&sort=ga:source,-ga:visits,ga:pageviews

Sort: Order the results in a particular way

Page 17: GA Konferenz-2011 Nick Mihailovski_API

Simple API Query

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&filters=ga:transactionRevenue>0

Filters: Only return a subset of the values

Page 18: GA Konferenz-2011 Nick Mihailovski_API

Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&segment=

Segment: Advanced segment query parameter

Page 19: GA Konferenz-2011 Nick Mihailovski_API

Default and Custom Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&segment=gaid::-11

gaid:: Reference the segment by ID

Page 20: GA Konferenz-2011 Nick Mihailovski_API

Dynamic Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,ga:transactions,

ga:transactionRevenue

&segment= dynamic::

dynamic:: Define the segment on the fly

Page 21: GA Konferenz-2011 Nick Mihailovski_API

Dynamic Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,ga:transactions,

ga:transactionRevenue

&segment=dynamic::ga:transactionRevenue >1000

For all visits that had greater than $1000 in revenue

Page 22: GA Konferenz-2011 Nick Mihailovski_API

Dynamic Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,ga:transactions,

ga:transactionRevenue

&segment=dynamic::ga:transactionRevenue>1000 ;

ga:day==Monday

For all visits that had greater than $1000 in revenue ANDmade a purchase on Monday

Page 23: GA Konferenz-2011 Nick Mihailovski_API

Dynamic Advanced Segments

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions ,ga:transactions ,

ga:transactionRevenue

&segment=dynamic::ga:transactionRevenue>1000 ;

ga:day =~Monday|Wednesday

For all visits that had greater than $1000 in revenue ANDmade a purchase either on Monday OR Wednesday

Page 24: GA Konferenz-2011 Nick Mihailovski_API

How the API works

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2009-10-01

&end-date=2009-10-31

&dimensions=ga:source

&metrics=ga:visits,

ga:transactions,

ga:transactionRevenue

API Query

HTTP Request

Processing

XML Response HTTP Response<feed>

<entry><dxp:dimension name='ga:source' value='blogger.com'/ ><dxp:dimension name='ga:medium' value='referral'/><dxp:metric name='ga:visits' type='integer' value='6 8140'/><dxp:metric name='ga:bounces' type='integer' value=' 61095'/>

</entry><entry>

<dxp:dimension name='ga:source' value=’google.com'/><dxp:dimension name='ga:medium' value=’organic'/><dxp:metric name='ga:visits' type='integer' value=‘5 4140'/><dxp:metric name='ga:bounces' type='integer' value=‘ 48095'/>

</entry></feed>

Page 25: GA Konferenz-2011 Nick Mihailovski_API

Accessing Report Data

Metric Totals

Rows of DataTotal Results

Page 26: GA Konferenz-2011 Nick Mihailovski_API

API Response

<feed><openSearch:totalResults>6451</openSearch:totalResu lts><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage >

<dxp:aggregates><dxp:metric name='ga:visits' type='integer' value='1 36540'/><dxp:metric name='ga:bounces' type='integer' value=' 101535'/>

</dxp:aggregates>

<entry><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name='ga:medium' value='referral'/><dxp:metric name='ga:visits' type='integer' value='6 8140'/><dxp:metric name='ga:bounces' type='integer' value=' 61095'/>

</entry><entry>

<dxp:dimension name='ga:source' value=’google.com'/><dxp:dimension name='ga:medium' value=’organic'/><dxp:metric name='ga:visits' type='integer' value=‘5 4140'/><dxp:metric name='ga:bounces' type='integer' value=‘ 48095'/>

</entry></feed>

Page 27: GA Konferenz-2011 Nick Mihailovski_API

API Response

<feed><openSearch: totalResults >6451 </openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage >

<dxp:aggregates><dxp:metric name='ga:visits' type='integer' value='1 36540'/><dxp:metric name='ga:bounces' type='integer' value=' 101535'/>

</dxp:aggregates>

<entry><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name='ga:medium' value='referral'/><dxp:metric name='ga:visits' type='integer' value='6 8140'/><dxp:metric name='ga:bounces' type='integer' value=' 61095'/>

</entry><entry>

<dxp:dimension name='ga:source' value=’google.com'/><dxp:dimension name='ga:medium' value=’organic'/><dxp:metric name='ga:visits' type='integer' value=‘5 4140'/><dxp:metric name='ga:bounces' type='integer' value=‘ 48095'/>

</entry></feed>

Page 28: GA Konferenz-2011 Nick Mihailovski_API

API Response

<feed><openSearch:totalResults>6451</openSearch:totalResu lts><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage >

<dxp: aggregates ><dxp:metric name=' ga:visits ' type='integer' value=' 136540 '/><dxp:metric name=' ga:bounces ' type='integer' value=' 101535 '/>

</dxp:aggregates>

<entry><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name='ga:medium' value='referral'/><dxp:metric name='ga:visits' type='integer' value='6 8140'/><dxp:metric name='ga:bounces' type='integer' value=' 61095'/>

</entry><entry>

<dxp:dimension name='ga:source' value=’google.com'/><dxp:dimension name='ga:medium' value=’organic'/><dxp:metric name='ga:visits' type='integer' value=‘5 4140'/><dxp:metric name='ga:bounces' type='integer' value=‘ 48095'/>

</entry></feed>

Page 29: GA Konferenz-2011 Nick Mihailovski_API

API Response

<feed><openSearch:totalResults>6451</openSearch:totalResu lts><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>5</openSearch:itemsPerPage >

<dxp:aggregates><dxp:metric name='ga:visits' type='integer' value='1 36540'/><dxp:metric name='ga:bounces' type='integer' value=' 101535'/>

</dxp:aggregates>

<entry ><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name=' ga:source ' value=' blogger.com '/><dxp:dimension name=' ga:medium ' value=' referral '/><dxp:metric name=' ga:visits ' type='integer' value=' 68140 '/><dxp:metric name=' ga:bounces ' type='integer' value=' 61095 '/>

</entry><entry >

<dxp:dimension name=' ga:source ' value=’ google.com '/><dxp:dimension name=' ga:medium ' value=’ organic '/><dxp:metric name=' ga:visits ' type='integer' value=‘ 54140 '/><dxp:metric name=' ga:bounces ' type='integer' value=‘ 48095 '/>

</entry></feed>

Page 30: GA Konferenz-2011 Nick Mihailovski_API

Query Explorer Demo

Page 31: GA Konferenz-2011 Nick Mihailovski_API

Agenda

What is the API & Why It’s Important

3 Awesome Tools

Advanced Data Uses

1

2

3

Page 32: GA Konferenz-2011 Nick Mihailovski_API

3 Awesome Tools

Next Analytics

• Increase productivity

Analytics Canvas

• Make data meaningful to your business

4Q

• Better understand customers through integrations

Page 33: GA Konferenz-2011 Nick Mihailovski_API

3 Awesome Tools

Next Analytics

• Increase productivity

Analytics Canvas

• Make data meaningful to your business

4Q

• Better understand customers through integrations

Page 34: GA Konferenz-2011 Nick Mihailovski_API
Page 35: GA Konferenz-2011 Nick Mihailovski_API

Next Analytics

www.excel.nextanalytics.comwww.excel.nextanalytics.com

Page 36: GA Konferenz-2011 Nick Mihailovski_API

3 Awesome Tools

Next Analytics

• Increase productivity

Analytics Canvas

• Make data meaningful to your business

4Q

• Better understand customers through integrations

Page 37: GA Konferenz-2011 Nick Mihailovski_API

By Country

Page 38: GA Konferenz-2011 Nick Mihailovski_API

By City

Page 39: GA Konferenz-2011 Nick Mihailovski_API

By Regional Market ?

Page 40: GA Konferenz-2011 Nick Mihailovski_API

Analytics Canvas

www.analyticscanvas.comwww.analyticscanvas.com

Page 41: GA Konferenz-2011 Nick Mihailovski_API

3 Awesome Tools

Next Analytics

• Increase productivity

Analytics Canvas

• Make data meaningful to your business

4Q

• Better understand customers through integrations

Page 42: GA Konferenz-2011 Nick Mihailovski_API

Google Analytics Describes the What

Your campaign drove a significant amount of traffic.

But was it qualified?

There was an increase in traffic to your support page. traffic to your support page.

Was there a problem with

the site or your product?

Time on site increased.

Were visitors more engaged

or simply unable to find what

they were looking for?

Page 43: GA Konferenz-2011 Nick Mihailovski_API

Case Study

Media client focusing on Online Publishing

• Rolling out paid access to premium articles

• Customers make purchase decision after reading article abstract

Due Diligence

• Market research

• Needs assessment

• Price sensitivity

Undesirable Results

• Very low conversion 0.5% purchase articles

Page 44: GA Konferenz-2011 Nick Mihailovski_API

4Q Answers

80% of visitors view abstracts, but only 0.5% purchase articles

53% found abstracts were too

short to make purchase decision• “If I have to pay extra for articles, at least give me a

+

• “If I have to pay extra for articles, at least give me a better idea of what the articles are about.”

• “The blurbs for your paid articles are not detailed enough.”

• “The summary of the article seems interesting but I’m not paying $6.95 to find out that it isn’t what I thought it was”

The Decision – Longer abstracts

The Result – 5x increase – from $40k/month up to $200k/month

Page 45: GA Konferenz-2011 Nick Mihailovski_API

Google Analytics & 4Q

• Developed in consultation

with Avinash Kaushik

• Asks the “most important

survey questions”

• Free & paid subscriptions

• Simple integration with Google

Analytics

• Feature rich, even at the

“free” level

Page 46: GA Konferenz-2011 Nick Mihailovski_API

Understand the why

How would you rate your overall site experience?

What was the purpose of your visit?

Did you accomplish the purpose of your visit?

If not, why not?

Page 47: GA Konferenz-2011 Nick Mihailovski_API

Technical Integration

4Q Suite displays survey when user leaves the site

If user accepts, both 4Q Suite and GA sessions are joined

Survey is taken by visitorsSurvey is taken by visitors

Upon completion, survey data is sent as events to Google Analytics

Page 48: GA Konferenz-2011 Nick Mihailovski_API

4Q Data Inside Google Analytics

Integrate Into Custom Reports Setup Advanced Segments

Page 49: GA Konferenz-2011 Nick Mihailovski_API

Deeper Understanding of Your Visitors

Improve content based on site experience score

Optimize AdWords bids based on the purpose of a visit

Page 50: GA Konferenz-2011 Nick Mihailovski_API

Agenda

What is the API & Why It’s Important

3 Awesome Tools

Advanced Data Uses

1

2

3

Page 51: GA Konferenz-2011 Nick Mihailovski_API
Page 52: GA Konferenz-2011 Nick Mihailovski_API
Page 53: GA Konferenz-2011 Nick Mihailovski_API

Content ID

_gaq.push([‘_trackPageview’]);

Google Analytics

https://www.google.com/analytics/feeds/data

?ids=ga:12345

&start-date=2011-04-20&end-date=2011-04-20

&dimensions=ga:pagePath

&metrics=ga:pageviews

&sort=-ga:pageviews

Page 54: GA Konferenz-2011 Nick Mihailovski_API
Page 55: GA Konferenz-2011 Nick Mihailovski_API
Page 56: GA Konferenz-2011 Nick Mihailovski_API

_gaq.push([‘_trackPageview’, ‘/agreeButton’]);

Google Analytics

https://www.google.com/analytics/feeds/data

?ids=ga:12345&start-date=2011-04-20&end-date=2011-04-20

&dimensions=ga:latitude,ga:longitude

&metrics=ga:visitors

&filter=ga:pagePath==/agreeButtom

Google Charts API

Page 57: GA Konferenz-2011 Nick Mihailovski_API

API Resources

App Galleryhttp://www.google.com/analytics/apps

Documentationhttp://code.google.com/apis/analytics

Developer GroupDeveloper Grouphttp://groups.google.com/group/google-analytics-api

Notify Grouphttp://groups.google.com/group/google-analytics-api-notify

57