Using the Google Analytics API to make most popular pages widgets for your website
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Using the Google Analytics API to make most popular pages widgets for your website

on

  • 8,936 views

Using the Google Analytics API to create a most popular pages widget for your website or blog using the Google Analytics API. I'll demonstrate a custom report in Google Analytics, then show how to ...

Using the Google Analytics API to create a most popular pages widget for your website or blog using the Google Analytics API. I'll demonstrate a custom report in Google Analytics, then show how to automate the same using Perl and the Google Analytics API to create an RSS feed of the top 10 stories from my blog — which I then incorporate into the siderail of my blog using a WordPress RSS widget.

Here's the link to code in GitHub:
http://bitly.com/ga-api2mpp?slideshare

Statistics

Views

Total Views
8,936
Views on SlideShare
8,932
Embed Views
4

Actions

Likes
2
Downloads
23
Comments
1

3 Embeds 4

http://www.slashdocs.com 2
http://sitebuilder.yola.com 1
http://kred.com 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs LicenseCC Attribution-NonCommercial-NoDerivs License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • This is a super handy presentation, Dean, thanks! It actually gave us some inspiration to write a tutorial on how to do this, but in real-time, with GoSquared: https://www.gosquared.com/blog/show-popular-content-on-your-site
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Using the Google Analytics API to make most popular pages widgets for your website Presentation Transcript

  • 1. Using the Google Analytics API ...
    • … to make most popular pages
    • widgets for your website.
    • by
    • @DeanPeters
    • HealYourChurchWebSite.com
    • Slides: http://slidesha.re/gaapi2mpp
    • Code: http://bitly.com/ga-api2mpp
  • 2. Intro
    • Who am I?
        • I'm the artist+geek linchpin Seth Godin warned you about.
    • What do I do?
        • I manage one of the Support Development Teams at McClatchy Interactive.
    • Why am I doing this presentation?
        • I'm a self-admitted analytics and social media API junkie
  • 3. Some funs stuff I've done
    • FaceBook Like Button
        • Wrote a popular Facebook like button plugin for WordPress
    • Heal Your Church Website
        • Where I blog about my usability & API addictions
    • Son of Web Pages that Suck
        • I was a contributing author to that 2002 classic
  • 4. Most Popular Pages Widget
    • What is it?
        • It's usually a box on the side rail that list linked titles to the most read stories on a website or blog
    • How popular is it?
        • You often see this widget on news media sites
    • Can we see some examples?
        • Sure
  • 5. Bradenton Herald
  • 6. USA Today
  • 7. Lexington Herald-Leader
  • 8. Most Popular Pages
    • Where do they get the data?
        • From sources such as Google Analytics & Omniture
    • Can I do this with my website or Blog?
        • Sure
  • 9. What you'll need
    • A Website or Blog
        • For today's example, we'll use WordPress
    • An Analytics Service with an API
        • For today's example, we'll use Google Analytics
    • A programming language
        • For today's example, we'll use Perl
  • 10. Google Analytics Dashboard
    • Standard Reporting
        • How to filter your popular pages via GA's standard reports
  • 11. Google Analytics Dashboard
    • Custom Reporting
        • How to create a custom report
  • 12. Why You Need an API
    • Exporting from the Dashboard ...
        • … is a process that is tedious and unsustainable
    • Using an API ...
        • … allows you to automate this process
    • Using a Programming Language ...
        • … let's you fine-tune the data and reports you need
  • 13. What is the Google API?
    • One of many API web services ...
        • … found at http://code.google.com/more/
    • What does it provide?
        • Programmatic access to Google Analytics report data & statistics derived from the data collected on your site, organized as dimensions and metrics .
  • 14. Dimensions & Metrics
    • You've already seen these ...
        • … in custom & standard reports
    • Dimensions ...
        • … are the rows of data
    • Metrics ...
        • … are columns of data in the rows
  • 15. Accessing the API
    • You'll need to be authenticated ...
        • … in this case we'll use a gmail id & password
    • You'll need the Profile ID ...
        • … this is NOT the UA key
    • You'll need to filter the data ...
        • … using our old friends dimensions & metrics
  • 16. Coding for the API
    • You'll need to be authenticated ...
        • … with Perl, we'll use Net::Google::AuthSub
    • You'll need to talk via your Profile ID ...
        • … with Perl, we'll use Net::Google::Analytics
    • You'll need to output the data ...
        • … with Perl, we'll use XML::FeedPP
  • 17. ga-api2mpp.pl
    • This is where I show you some code
  • 18. Limitations of the API
    • Authentication is often a hurdle ...
        • … for Google Analytics, investigate using OAuth
    • Be careful of quanity ...
        • … don't get penalized for asking for everything all the time
    • Don't expect miracles ...
        • … the quality of the data you pull is directly proportional to to how well you've setup & configured Google Analytics
  • 19. Implementing the Code
    • Crontab the program
        • * */12 * * * perl ga-api2mpp.pl username@gmail.com password
    • Add the output to your blog ...
        • … here's where I show you some WordPress widgetry
  • 20. Voilà
    • This is where I show you some results
  • 21. Take-Aways
    • Coding is 'easy-enough' ...
        • … if you let other libraries & modules do the heavy-lifting
    • Garbage-in/Garbage-out ...
        • … the API can only 'pull' what data your actively tracking
    • Have fun & explore...
        • … you'll be amazed at how many different and cool ways you can slice-n-dice your data in a coder's context
  • 22. Questions & Answers
    • On creating a Most Popular Pages widget for your website using the Google API.
    • by
    • @DeanPeters
    • HealYourChurchWebsite.com
    • Slides:http://slidesha.re/gaapi2mpp
    • Code: http://bitly.com/ga-api2mpp