hybridgroup/gabba — pull request #11 by jontaylor (2012-04-20 15:58:23+00:00)
Title: Set the @utma instance variable if gabba generates it

This way if gabba generates the utma value we can persist it in some way so that we don't get every page hit appearing to be a new visitor.

In my own code (using rails) I do the following.

def update_google_analytics_page_hit
if Rails.env.production? && request.get?
gabba = Gabba::Gabba.new("MY-UA", "MY-DOMAIN")
gabba.identify_user(cookies[:__utma])
gabba.page_view("TITLE", request.fullpath)
cookies['__utma'] ||= gabba.utma
end
end