User behavior tracking can be difficult. If done properly, it can be invaluable in helping to shape the evolution of your product. Done poorly, and it can lead to expensive mistakes. Learn the tools and techniques that will help you make the right choices. If you'd like to do this, check out Legato: https://github.com/tpitale/legato
35. def create
@thing = Thing.new(params[:thing])
if @thing.save
track_pageview("/things/create")
flash[:notice] = "Thanks for saving that thing."
redirect_to thing_path(@thing)
else
render :action => :new
end
end
36. def create
@thing = Thing.new(params[:thing])
if @thing.save
track_pageview("/things/create")
flash[:notice] = "Thanks for saving that thing."
redirect_to thing_path(@thing)
else
render :action => :new
end
end
37. def analytics_pusher_meta_tag
meta_tags = ""
if track_pageview?
content = Rack::Utils.escape_html(session.delete(:pageview_to_track))
meta_tags << %(<meta name="track-pageview" content="#{content}" />)
end
meta_tags.html_safe
end
58. class Landings
extend Garb::Resource
metrics :entrances
dimensions :landing_page_path
sort :entrances
filters :landing_page_path.contains => 'blog'
# OR
filters do
contains(:landing_page_path, 'blog')
end
end
82. _gaq.push(['_setCustomVar', 1, 'logged-in', 'member', 1]);
// or as an admin, to partition their data
_gaq.push(['_setCustomVar', 1, 'logged-in', 'admin', 1]);
_gaq.push(['_trackPageview']);
83. // track just this pageview to a custom variable
_gaq.push(['_setCustomVar', 1, 'purchase', 'level-2', 3]);
_gaq.push(['_trackPageview']);
// what do users do the rest of this session
_gaq.push(['_setCustomVar', 1, 'purchase', 'level-2', 2]);
_gaq.push(['_setCustomVar', 2, 'upgrade', '1', 2]); // use slot 2
_gaq.push(['_trackPageview']);
97. # in file experiments/metrics/signup.rb
metric "Signup (Activation)" do
description "Measures how many people signed up for our awesome service."
end
98. # looks for the metric in experiments/metrics/signup.rb
# done in UsersController#create, for example
track! :signup
104. ab_test "Tagline" do
description "Testing to see if a different tag line increases number of signups."
alternatives "Buy Now!", "Signup for Free!", "Always Free, Signup Now!"
metrics :signup
end
111. metric "Signups Welcomed" do
google_analytics "UA-65432-1"
# report is an instance of Garb::Report
report.metrics :visits
report.dimensions :page_path
report.filters do
eql(:page_path, 'welcome')
end
end
113. metric "Activation" do
description "Measure page views for /"
def values(from, to)
report = Garb::Report.new(ACTIVE_PROFILE, {:start_date => from, :end_date => to})
report.metrics :pageviews
report.dimensions :page_path, :date
report.sort :date
report.filters do
eql :page_path, '/'
end
# hack because data isn't returned if it's 0
data = report.results.inject({}) do |hash, result|
hash.merge(result.date => result.pageviews.to_i)
end
(from..to).map do |day|
key = day.strftime('%Y%m%d')
data[key] || 0
end
end
end
Title: &#x201C;Build it and they will come&#x201D; &#x2026; Sucks.
Summary:
User behavior tracking can be difficult. If done properly, it can be invaluable in helping to shape the evolution of your product. Done poorly, and it can lead to expensive mistakes. Learn the tools and techniques that will help you make the right choices.
Abstract:
The most successful applications start off with a good idea. From this idea, features and services are created to fulfill the needs of users. Determining how users act when given features has proven to be the best method for guiding feature design. Unfortunately, making this determination is often an expensive challenge, especially if done improperly. This talk will provide you with new tools and techniques to aid gathering information to make these decisions.
With the bulk of the talk I will cover all you will need to know to get information back out of Google Analytics (GA), using Garb to access the API provided by Google. In addition, I will discuss, in-depth techniques and examples for gathering the best data using GA. I will touch briefly on the benefits of A/B testing in order to introduce Vanity. Lastly, I will present techniques for combining data gathered with GA and metrics from Vanity to create a vivid picture of user behavior and how this data might be presented to encourage users.
All in all, Google Analytics provides the gateway to a more complete analysis of user behavior, and an invaluable tool for planning the features and growth of your application. Let me show you how to leverage them.