19
Claye Stokes twitter.com/claye linkedin.com/in/ claye Director of SEO Google Analytics API and Advanced Application Google Plus: http://goo.gl/cEhGC

Google Analytics API and Advanced Application

  • Upload
    seocom

  • View
    123

  • Download
    2

Embed Size (px)

DESCRIPTION

View the blog post and get the excel doc here: http://www.seo.com/blog/how-to-pull-custom-google-analytics-reports-into-google-spreadsheets/

Citation preview

Page 1: Google Analytics API and Advanced Application

Claye Stokes

twitter.com/clayelinkedin.com/in/claye

Director of SEO

Google Analytics API and Advanced Application

Google Plus: http://goo.gl/cEhGC

Page 2: Google Analytics API and Advanced Application

High Level First, Then Drilling Down

• GA (Google Analytics) is NOT just for websites!– Google Analytics Android SDK

• Can’t track what we’re not measuring!• SDK Tracks:

– Events– Ecommerce– Market Referrals– Pageviews– Unique Users– Custom Variables

Tweet @claye questions

Page 3: Google Analytics API and Advanced Application

Track Everything

– All actions– Form submissions (lead generation, newsletters, etc.)– Errors– Downloads– Game modes (single vs multiplayer)– Times (time it takes to complete a level, build a doc)– Step completion (in multi-step forms and checkout

processes)– Registration

Tweet @claye questions

Page 4: Google Analytics API and Advanced Application

How to Track

• Use Pageviews when content changes• Use Event Tracking for actions

– Example: tracker.trackPageView(“/” + this.getLocalClassName());

– Documentation: https://developers.google.com/analytics/devguides/collection/android/

Tweet @claye questions

Page 5: Google Analytics API and Advanced Application

Listen App

Page 6: Google Analytics API and Advanced Application
Page 7: Google Analytics API and Advanced Application
Page 8: Google Analytics API and Advanced Application

More Events

• Why not track errors with Google Analytics?– Category: Error– Action: [action that triggered the exception]

• Time can be tracked, for example:– Category: Podcast– Action: Play– Label: [Title of Podcast]– Value: 15:23

Page 9: Google Analytics API and Advanced Application

Using the Reports

• Segment!– How does your app perform on various devices?– How does that affect user behavior?– Screen resolution?– Landscape vs Portrait?

Tweet @claye questions

Page 10: Google Analytics API and Advanced Application

Google Analytics API

• Get the good stuff! (Reports that are impossible to get by logging in)– Example: goal completions (conversions) by

keyword• Documentation:

https://developers.google.com/analytics/devguides/

Tweet @claye questions

Page 11: Google Analytics API and Advanced Application

Google Spreadsheets + GA API

• Using Apps Script, we can access the Google Analytics API to pull anything we want (up to 10,000 rows!)

• Credit where it’s due: thanks to Mikael Thuneberg for making his code public: http://www.automateanalytics.com/

Tweet @claye questions

Page 12: Google Analytics API and Advanced Application

Example Spreadsheet: GA Report Builder

• http://goo.gl/QqlHZ • Go create a copy for yourself and start playing with

it!– Click File -> Make a Copy…– On the Settings tab, enter your Google Analytics

username/password– Find your profile number by logging into your report at

www.google.com/analytics, find the number with a ‘p’ preceding it

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 13: Google Analytics API and Advanced Application

GA Report Builder

• Required fields– Start/End Dates– Dimensions (rows)– Metrics (columns)

• Optional– Segments (default AND custom, advanced

segments)– Filters

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 14: Google Analytics API and Advanced Application

How it Works

• First, we do some validation

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 15: Google Analytics API and Advanced Application

How it Works

• Encode the password

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 16: Google Analytics API and Advanced Application

How it Works

• Authenticate

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 17: Google Analytics API and Advanced Application

How it Works

• Take the response, handle errors

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 18: Google Analytics API and Advanced Application

How it Works

• Request data from the API

• Request URL:

• Then, stack the response in an Array and output

Tweet @claye questions, Report: http://goo.gl/QqlHZ

Page 19: Google Analytics API and Advanced Application

Resources:• Google Analytics Reporting API: http://

code.google.com/apis/analytics/docs/gdata/home.html– V3: http://code.google.com/apis/analytics/docs/gdata/home.html

• Google Data Feed Query Explorer: http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html

• Google Apps Script Documentation: http://code.google.com/googleapps/appsscript/

• http://www.peakconversion.com/2012/01/using-the-google-analytics-data-api-with-google-docs-spreadsheet/

• http://www.automateanalytics.com/• Watch for my posts on the SEO.com blog (www.seo.com/blog) for

updates and new Google Analytics toolsTweet @claye questions, Report: http://goo.gl/QqlHZ