Set the @utma instance variable if gabba generates it #11

Merged
merged 1 commit into from Apr 20, 2012

Conversation

Projects
None yet
2 participants

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
Jonathan Taylor Set the utma instance variable so that we can pull it out later to pe…
…rsist it in the users cookie
bb75c81

deadprogram merged commit acff152 into hybridgroup:master Apr 20, 2012

Owner

deadprogram commented Apr 20, 2012

Thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment