Module: OmnitureHelper

Defined in:
app/helpers/omniture_helper.rb

Instance Method Summary collapse

Instance Method Details

#application_nameObject



16
17
18
# File 'app/helpers/omniture_helper.rb', line 16

def application_name
  Omniture.application_name
end

#asyncomni_content_tagObject



28
29
30
31
32
# File 'app/helpers/omniture_helper.rb', line 28

def 
  if Omniture.enabled?
   tag(:iframe, id: 'omnitureFrame', name: 'omnitureFrame', width: '0', height: '0', style: 'visibility:hidden', data: {'page-name' =>  page_name, 'omniture-url' =>  omniture_url })
  end
end

#omniture_formatted_timeObject



42
43
44
# File 'app/helpers/omniture_helper.rb', line 42

def omniture_formatted_time
  Time.now.strftime('%m/%d/%Y %I:%M:%S %p')
end

#omniture_query_param(prop) ⇒ Object



12
13
14
# File 'app/helpers/omniture_helper.rb', line 12

def omniture_query_param(prop)
  "#{prop}=#{self.send(prop)}"
end

#omniture_trackable_propertiesObject



8
9
10
# File 'app/helpers/omniture_helper.rb', line 8

def omniture_trackable_properties
  [:page_name, :user_id, :application_name]
end

#omniture_urlObject



2
3
4
5
6
# File 'app/helpers/omniture_helper.rb', line 2

def omniture_url    
  url = omniture_index_url
  param_pair = omniture_trackable_properties.collect{|p| omniture_query_param(p)}
  "#{url}?#{param_pair.join('&')}"
end

#page_nameObject



34
35
36
37
38
39
40
# File 'app/helpers/omniture_helper.rb', line 34

def page_name
  name = []
  name << application_name
  name << controller_name.gsub('/','_').camelize
  name << action_name.gsub('/','_').camelize
  name.join('_')
end

#user_idObject



20
21
22
23
24
25
26
# File 'app/helpers/omniture_helper.rb', line 20

def user_id
  begin 
    current_user.id
  rescue
    "unknown"
  end
end