Module: OmnitureHelper
- Defined in:
- app/helpers/omniture_helper.rb
Instance Method Summary collapse
- #application_name ⇒ Object
- #asyncomni_content_tag ⇒ Object
- #omniture_formatted_time ⇒ Object
- #omniture_query_param(prop) ⇒ Object
- #omniture_trackable_properties ⇒ Object
- #omniture_url ⇒ Object
- #page_name ⇒ Object
- #user_id ⇒ Object
Instance Method Details
#application_name ⇒ Object
16 17 18 |
# File 'app/helpers/omniture_helper.rb', line 16 def application_name Omniture.application_name end |
#asyncomni_content_tag ⇒ Object
28 29 30 31 32 |
# File 'app/helpers/omniture_helper.rb', line 28 def asyncomni_content_tag 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_time ⇒ Object
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_properties ⇒ Object
8 9 10 |
# File 'app/helpers/omniture_helper.rb', line 8 def omniture_trackable_properties [:page_name, :user_id, :application_name] end |
#omniture_url ⇒ Object
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_name ⇒ Object
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_id ⇒ Object
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 |