Class: Sentiero::Web::Views::ConversionsView

Inherits:
BaseView
  • Object
show all
Defined in:
lib/sentiero/web/views/conversions_view.rb

Constant Summary

Constants inherited from BaseView

BaseView::TEMPLATES_DIR, BaseView::TEMPLATE_CACHE

Constants included from Escaping

Escaping::HTML_UNSAFE_IN_SCRIPT, Escaping::HTML_UNSAFE_IN_SCRIPT_PATTERN

Instance Attribute Summary collapse

Attributes inherited from BaseView

#base_path, #csrf_token

Instance Method Summary collapse

Methods inherited from BaseView

#built_asset, compiled_template, #escape_js, #h, #range_pairs, #render, #render_layout, #render_partial, #render_session_row

Methods included from Formatting

#format_duration, #format_vital, #parse_browser, #parse_device

Methods included from Escaping

#escape_html, #escape_js_string, #escape_json

Constructor Details

#initialize(tags:, selected_tag:, entry_pages:, referrers:, utm:, was_truncated:, since:, until_str:) ⇒ ConversionsView

Returns a new instance of ConversionsView.



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sentiero/web/views/conversions_view.rb', line 9

def initialize(tags:, selected_tag:, entry_pages:, referrers:, utm:, was_truncated:, since:, until_str:)
  super()
  @tags = tags
  @selected_tag = selected_tag
  @entry_pages = entry_pages
  @referrers = referrers
  @utm = utm
  @was_truncated = was_truncated
  @since = since
  @until_str = until_str
end

Instance Attribute Details

#entry_pagesObject (readonly)

Returns the value of attribute entry_pages.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def entry_pages
  @entry_pages
end

#referrersObject (readonly)

Returns the value of attribute referrers.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def referrers
  @referrers
end

#selected_tagObject (readonly)

Returns the value of attribute selected_tag.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def selected_tag
  @selected_tag
end

#sinceObject (readonly)

Returns the value of attribute since.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def since
  @since
end

#tagsObject (readonly)

Returns the value of attribute tags.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def tags
  @tags
end

#until_strObject (readonly)

Returns the value of attribute until_str.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def until_str
  @until_str
end

#utmObject (readonly)

Returns the value of attribute utm.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def utm
  @utm
end

#was_truncatedObject (readonly)

Returns the value of attribute was_truncated.



21
22
23
# File 'lib/sentiero/web/views/conversions_view.rb', line 21

def was_truncated
  @was_truncated
end

Instance Method Details

#facetsObject



29
30
31
32
33
34
35
36
37
# File 'lib/sentiero/web/views/conversions_view.rb', line 29

def facets
  [
    ["Entry page", "entry page", entry_pages, nil],
    ["Referrer", "referrer", referrers, nil],
    ["UTM source", "UTM source", utm[:source], :utm],
    ["UTM medium", "UTM medium", utm[:medium], :utm],
    ["UTM campaign", "UTM campaign", utm[:campaign], :utm]
  ]
end


25
26
27
# File 'lib/sentiero/web/views/conversions_view.rb', line 25

def player_link(ex)
  "#{h(base_path)}/sessions/#{h(ex[:session_id].to_s)}/windows/#{h(ex[:window_id].to_s)}?t=#{ex[:offset_ms].to_i}"
end

#templateObject



23
# File 'lib/sentiero/web/views/conversions_view.rb', line 23

def template = "analytics_conversions.html.erb"