Class: Garails::GoogleAnalyticsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/garails/google_analytics_controller.rb

Constant Summary collapse

UTM_HEADERS =
{
"Content-Type" => "image/gif",
"Cache-Control" => "private, no-cache, no-cache=Set-Cookie, proxy-revalidate",
"Pragma" => "no-cache",
"Expires" => "Wed, 17 Sep 1975 21:32:10 GMT" }
UTM_GIF_DATA =
[
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x01, 0x00, 0x01, 0x00, 0x80, 0xff,
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x44, 0x01, 0x00, 0x3b ].map{|i| i.chr }.join
"__utmmobile"

Instance Method Summary collapse

Instance Method Details

#utmObject



19
20
21
22
23
24
25
# File 'app/controllers/garails/google_analytics_controller.rb', line 19

def utm
  record_access if Garails.ga_setup?
  response.headers.merge(UTM_HEADERS)
  respond_to do |format|
    format.gif { send_data UTM_GIF_DATA, :type => :gif, :disposition => "inline" }
  end
end