Google AnalyticsBecoming More Productive Using The Analytics API
Nick MihailovskiSr. Developer Programs Engineer
Google Analytics
Web Analytics TV
Agenda
What is the API & Why It’s Important
3 Awesome Tools
Advanced Data Uses
1
2
3
Agenda
What is the API & Why It’s Important
3 Awesome Tools
Advanced Data Uses
1
2
3
Developer Platform Overview
Account Configuration
Tracking Code Reports
Processing
Developer Platform Overview
Management API
ga.js / Mobile SDK Data Export API
Processing
How the Web Interface works
HTTP Request
Processing
HTTP Response
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>
Retrieving Data From The API
Filters
Date Range
Sort
Profile
Advanced Segments
Dimensions Metrics
Start IndexMax Results
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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>
Accessing Report Data
Metric Totals
Rows of DataTotal Results
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>
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>
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>
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>
Query Explorer Demo
Agenda
What is the API & Why It’s Important
3 Awesome Tools
Advanced Data Uses
1
2
3
3 Awesome Tools
Next Analytics
• Increase productivity
Analytics Canvas
• Make data meaningful to your business
4Q
• Better understand customers through integrations
3 Awesome Tools
Next Analytics
• Increase productivity
Analytics Canvas
• Make data meaningful to your business
4Q
• Better understand customers through integrations
Next Analytics
www.excel.nextanalytics.comwww.excel.nextanalytics.com
3 Awesome Tools
Next Analytics
• Increase productivity
Analytics Canvas
• Make data meaningful to your business
4Q
• Better understand customers through integrations
By Country
By City
By Regional Market ?
Analytics Canvas
www.analyticscanvas.comwww.analyticscanvas.com
3 Awesome Tools
Next Analytics
• Increase productivity
Analytics Canvas
• Make data meaningful to your business
4Q
• Better understand customers through integrations
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?
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
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
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
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?
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
4Q Data Inside Google Analytics
Integrate Into Custom Reports Setup Advanced Segments
Deeper Understanding of Your Visitors
Improve content based on site experience score
Optimize AdWords bids based on the purpose of a visit
Agenda
What is the API & Why It’s Important
3 Awesome Tools
Advanced Data Uses
1
2
3
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
_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
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
Top Related