Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Set the utma instance variable so that we can pull it out later to pe…

…rsist it in the users cookie
  • Loading branch information...
commit bb75c81ff95b14fddf2fd1d9b5e83f8aab8f75aa 1 parent b338f02
Jonathan Taylor authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/gabba/gabba.rb
View
7 lib/gabba/gabba.rb
@@ -22,7 +22,7 @@ class Gabba
ESCAPES = %w{ ' ! * ) }
- attr_accessor :utmwv, :utmn, :utmhn, :utmcs, :utmul, :utmdt, :utmp, :utmac, :utmt, :utmcc, :user_agent
+ attr_accessor :utmwv, :utmn, :utmhn, :utmcs, :utmul, :utmdt, :utmp, :utmac, :utmt, :utmcc, :user_agent, :utma
# Public: Initialize Gabba Google Analytics Tracking Object.
#
@@ -295,9 +295,8 @@ def identify_user(utma)
# create magical cookie params used by GA for its own nefarious purposes
def cookie_params(utma1 = random_id, utma2 = rand(1147483647) + 1000000000, today = Time.now)
- utma = @utma
- utma ||= "1.#{utma1}00145214523.#{utma2}.#{today.to_i}.#{today.to_i}.15"
- "__utma=#{utma};+__utmz=1.#{today.to_i}.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);"
+ @utma ||= "1.#{utma1}00145214523.#{utma2}.#{today.to_i}.#{today.to_i}.15"
+ "__utma=#{@utma};+__utmz=1.#{today.to_i}.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);"
end
# sanity check that we have needed params to even call GA
Please sign in to comment.
Something went wrong with that request. Please try again.