Permalink
Browse files

Merge pull request #11 from jontaylor/set_utma_instance_variable

Set the @utma instance variable if gabba generates it
  • Loading branch information...
2 parents b338f02 + bb75c81 commit acff15250253e4197dd103909ffac3e9fd2201df @deadprogram deadprogram committed Apr 20, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/gabba/gabba.rb
View
@@ -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

0 comments on commit acff152

Please sign in to comment.