Skip to content

Commit

Permalink
Added analytics information to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Nesbitt committed Jan 14, 2011
1 parent b10e37f commit dcf8f89
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions readme.textile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,32 @@ Or the shorthand form:
pre. Google::UrlShortener.expand!("http://goo.gl/r5akx") # => http://blog.josh-nesbitt.net


h3. Getting more data from an expanded url

More data is available from a URL once it's been expanded:

pre. url = Google::UrlShortener::Url.new(:short_url => "http://goo.gl/r5akx")
url.expand! # => http://blog.josh-nesbitt.net
url.created_at # => 2011-01-11
url.created_at.year # => 2011
url.analytics # => Google::UrlShortener::Analytics
url.analytics.all # => Google::UrlShortener::AnalyticsGroup
url.analytics.all.browsers # => { "Chrome" => 1 }
url.analytics.all.countries # => { "GB" => 1 }
url.analytics.all.platforms # => { "Macintosh" => 1 }
url.analytics.all.referrers # => { "Unknown/empty" => 1 }
url.analytics.all.long_url_clicks # => 23
url.analytics.all.short_url_clicks # => 3

Available scopes are:

pre. all
month
week
day
two_hours

E.g: @url.analytics.month@.

h2. Bugs

Expand Down

0 comments on commit dcf8f89

Please sign in to comment.