mitamirri 0.13.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. data/.document +5 -0
  2. data/.gitignore +26 -0
  3. data/README.rdoc +117 -0
  4. data/Rakefile +26 -0
  5. data/VERSION +1 -0
  6. data/app/controllers/application_controller.rb +10 -0
  7. data/app/controllers/trackable_actions_controller.rb +10 -0
  8. data/app/controllers/trackable_sessions_controller.rb +100 -0
  9. data/app/helpers/application_helper.rb +2 -0
  10. data/app/models/trackable_action.rb +193 -0
  11. data/app/models/trackable_location.rb +19 -0
  12. data/app/models/trackable_session.rb +352 -0
  13. data/app/models/trackable_stat.rb +64 -0
  14. data/app/views/layouts/application.html.erb +20 -0
  15. data/app/views/trackable_sessions/_keywords_graph.html.erb +24 -0
  16. data/app/views/trackable_sessions/_print_buttons.html.erb +3 -0
  17. data/app/views/trackable_sessions/_sessions.html.erb +26 -0
  18. data/app/views/trackable_sessions/_top_referrers.html.erb +24 -0
  19. data/app/views/trackable_sessions/_traffic_summary_all.html.erb +64 -0
  20. data/app/views/trackable_sessions/_traffic_summary_by_kind.html.erb +48 -0
  21. data/app/views/trackable_sessions/_visits_graph.html.erb +25 -0
  22. data/app/views/trackable_sessions/content.html.erb +119 -0
  23. data/app/views/trackable_sessions/explorer.html.erb +67 -0
  24. data/app/views/trackable_sessions/export.xls.erb +5 -0
  25. data/app/views/trackable_sessions/index.html.erb +47 -0
  26. data/app/views/trackable_sessions/intersite.html.erb +97 -0
  27. data/app/views/trackable_sessions/leads.html.erb +98 -0
  28. data/app/views/trackable_sessions/show.html.erb +113 -0
  29. data/app/views/trackable_sessions/visitor_profile.html.erb +114 -0
  30. data/config/boot.rb +110 -0
  31. data/config/database.yml +0 -0
  32. data/config/environment.rb +24 -0
  33. data/config/environments/development.rb +17 -0
  34. data/config/environments/production.rb +28 -0
  35. data/config/environments/test.rb +31 -0
  36. data/config/initializers/backtrace_silencers.rb +7 -0
  37. data/config/initializers/database.rb +1 -0
  38. data/config/initializers/inflections.rb +10 -0
  39. data/config/initializers/mime_types.rb +5 -0
  40. data/config/initializers/new_rails_defaults.rb +21 -0
  41. data/config/initializers/session_store.rb +15 -0
  42. data/config/locales/en.yml +5 -0
  43. data/config/routes.rb +11 -0
  44. data/db/development.sqlite3 +0 -0
  45. data/db/migrate/20100810173533_create_trackable_sessions.rb +23 -0
  46. data/db/migrate/20100810173605_create_trackable_actions.rb +20 -0
  47. data/db/test.sqlite3 +1 -0
  48. data/doc/README_FOR_APP +2 -0
  49. data/init.rb +8 -0
  50. data/lib/mitamirri/content_report.rb +75 -0
  51. data/lib/mitamirri/helper.rb +106 -0
  52. data/lib/mitamirri/intersite_traffic_report.rb +122 -0
  53. data/lib/mitamirri/leads_report.rb +90 -0
  54. data/lib/mitamirri/session_report.rb +219 -0
  55. data/lib/mitamirri/stat_report.rb +216 -0
  56. data/lib/mitamirri/tasks.rb +27 -0
  57. data/lib/mitamirri/visitor_profile_report.rb +127 -0
  58. data/lib/mitamirri.rb +15 -0
  59. data/log/development.log +0 -0
  60. data/log/production.log +0 -0
  61. data/log/server.log +0 -0
  62. data/log/test.log +0 -0
  63. data/mitamirri.gemspec +125 -0
  64. data/public/stylesheets/mitamirri.css +736 -0
  65. data/script/about +4 -0
  66. data/script/console +3 -0
  67. data/script/dbconsole +3 -0
  68. data/script/destroy +3 -0
  69. data/script/generate +3 -0
  70. data/script/performance/benchmarker +3 -0
  71. data/script/performance/profiler +3 -0
  72. data/script/plugin +3 -0
  73. data/script/runner +3 -0
  74. data/script/server +3 -0
  75. data/spec/controllers/trackable_actions_controller_spec.rb +5 -0
  76. data/spec/controllers/trackable_sessions_controller_spec.rb +5 -0
  77. data/spec/custom_matchers.rb +23 -0
  78. data/spec/helpers/application_helper_spec.rb +57 -0
  79. data/spec/lib/content_report_spec.rb +37 -0
  80. data/spec/lib/intersite_traffic_report_spec.rb +51 -0
  81. data/spec/lib/leads_report_spec.rb +46 -0
  82. data/spec/lib/session_report_spec.rb +107 -0
  83. data/spec/lib/stat_report_spec.rb +106 -0
  84. data/spec/models/trackable_action_spec.rb +42 -0
  85. data/spec/models/trackable_session_spec.rb +154 -0
  86. data/spec/rcov.opts +4 -0
  87. data/spec/schema.rb +34 -0
  88. data/spec/spec.opts +4 -0
  89. data/spec/spec_helper.rb +32 -0
  90. metadata +155 -0
@@ -0,0 +1,119 @@
1
+ <%- set_title "Content Report" -%>
2
+
3
+ <%- unless @report -%>
4
+ <div class="note"><span class="notification info"></span><p>This report displays the most popular content for the selected site(s) as well as the top entrance and exit pages per visit.</p></div>
5
+ <%- end -%>
6
+
7
+ <%- if @sites.size == 1 -%>
8
+ <p><b>No traffic data has been gathered yet. Please try again later.</b></p>
9
+ <%- else -%>
10
+ <form>
11
+ <fieldset class="form_container">
12
+ <%= legend_tag "Report Criteria" -%>
13
+ <div class="three_column">
14
+ <fieldset>
15
+ <label for="site">Site:</label><br />
16
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>
17
+ </fieldset>
18
+ </div>
19
+ <div class="three_column">
20
+ <fieldset>
21
+ <label for="time_period">Time Period:</label><br />
22
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>
23
+ </fieldset>
24
+ </div>
25
+ <div class="three_column">
26
+ <fieldset>
27
+ <label for="visit_kind">Traffic Type:</label><br />
28
+ <%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
29
+ </fieldset>
30
+ </div>
31
+ </fieldset>
32
+ <input type="submit" class="button" value="Generate Report" />
33
+ </form>
34
+ <%- end -%>
35
+
36
+ <%- if @report -%>
37
+
38
+ <br style="clear: both;" />
39
+
40
+ <%= Seer::init_visualization -%>
41
+
42
+ <fieldset class="form_container">
43
+ <%= legend_tag "Top Content", :help => 'This chart shows the top 25 most-requested pages across the selected site(s). Click on any bar in the graph for a count of visits to the corresponding page.' -%>
44
+ <br />
45
+ <div id="pages_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
46
+
47
+ <%= Seer::visualize(
48
+ @pages_series,
49
+ :as => :bar_chart,
50
+ :in_element => 'pages_chart',
51
+ :series => {:series_label => 'url', :data_method => 'views'},
52
+ :chart_options => {
53
+ :height => @pages_series.size * 20,
54
+ :width => 900,
55
+ :is_3_d => false,
56
+ :legend => 'none',
57
+ :colors => ["#7e7587"],
58
+ :title => "# of Page Views",
59
+ :title_font_size => 9,
60
+ :title_x => '',
61
+ :axis_font_size => 10
62
+ }
63
+ )
64
+ -%>
65
+ </fieldset>
66
+
67
+ <fieldset class="form_container">
68
+ <%= legend_tag "Entrance Pages", :help => 'This chart shows the top 25 pages that users initially visited across the selected site(s). Click on any bar in the graph for a count of visits to the corresponding page.' -%>
69
+ <br />
70
+ <div id="entrance_pages_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
71
+
72
+ <%= Seer::visualize(
73
+ @entrance_pages_series,
74
+ :as => :bar_chart,
75
+ :in_element => 'entrance_pages_chart',
76
+ :series => {:series_label => 'url', :data_method => 'views'},
77
+ :chart_options => {
78
+ :height => @entrance_pages_series.size * 20,
79
+ :width => 900,
80
+ :is_3_d => false,
81
+ :legend => 'none',
82
+ :colors => ["#7e7587"],
83
+ :title => "# of Page Views",
84
+ :title_font_size => 9,
85
+ :title_x => '',
86
+ :axis_font_size => 10
87
+ }
88
+ )
89
+ -%>
90
+ </fieldset>
91
+
92
+ <fieldset class="form_container">
93
+ <%= legend_tag "Exit Pages", :help => 'This chart shows the top 25 pages that users last visited before leaving the selected site(s). Click on any bar in the graph for a count of visits to the corresponding page.' -%>
94
+ <br />
95
+ <div id="exit_pages_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
96
+
97
+ <%= Seer::visualize(
98
+ @exit_pages_series,
99
+ :as => :bar_chart,
100
+ :in_element => 'exit_pages_chart',
101
+ :series => {:series_label => 'url', :data_method => 'views'},
102
+ :chart_options => {
103
+ :height => @exit_pages_series.size * 20,
104
+ :width => 900,
105
+ :is_3_d => false,
106
+ :legend => 'none',
107
+ :colors => ["#7e7587"],
108
+ :title => "# of Page Views",
109
+ :title_font_size => 9,
110
+ :title_x => '',
111
+ :axis_font_size => 10
112
+ }
113
+ )
114
+ -%>
115
+ </fieldset>
116
+
117
+ <%= render 'print_buttons' -%>
118
+
119
+ <%- end -%>
@@ -0,0 +1,67 @@
1
+ <%- title 'Traffic Explorer' -%>
2
+ <%= Seer::init_visualization -%>
3
+
4
+ <%- unless @sessions -%>
5
+ <div class="note"><span class="notification info"></span>
6
+
7
+ <p>This report allows you to filter website traffic by visit kind, site, action kind, and time period to better understand how visitors are using your site(s).</p>
8
+
9
+ <ul class="indented bulleted">
10
+ <%= content_tag('li', "<i>Clicks</i> represent button clicks.") if @kinds.include? 'clicks' -%>
11
+ <%= content_tag('li', "<i>Conversions</i> are lead forms that are submitted.") if @kinds.include? 'conversions' -%>
12
+ <%= content_tag('li', "<i>Scrolls</i> are page scrolls performed by visitors.") if @kinds.include? 'scrolls' -%>
13
+ <%= content_tag('li', "<i>Clicks</i> represent button clicks.") if @kinds.include? 'clicks' -%>
14
+ <%= content_tag('li', "<i>Mouseovers</i> represent mouseover events and may indicate that a user considered pressing a button, for example.") if @kinds.include? 'mouseovers' -%>
15
+ <%= content_tag('li', "<i>Clickthroughs</i> are clicks on links to other sites.") if @kinds.include? 'clickthroughs' -%>
16
+ </ul>
17
+ <br />
18
+ </div>
19
+ <%- end -%>
20
+
21
+ <%- if @sites.size == 1 || @kinds.blank? -%>
22
+ <p><b>No web traffic action data has been gathered yet. Please try again later.</b></p>
23
+ <%= link_to 'Back', :back, :class => 'button' -%>
24
+ <%- else -%>
25
+ <form>
26
+ <fieldset class="form_container">
27
+ <%= legend_tag "Data Explorer Criteria" -%>
28
+ <br />
29
+ How many
30
+ <%= select_tag "visit_kind", options_for_select((TrackableSession::KINDS | ["total"]), params[:visit_kind] == 'all' ? 'total' : params[:visit_kind] ) -%>
31
+ visits to
32
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "all sites") -%>
33
+ resulted in
34
+ <%= select_tag "action_kind", options_for_select(@kinds, params[:action_kind]) -%>
35
+ in the
36
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period]) -%>
37
+ ?
38
+ </fieldset>
39
+ <input type="submit" class="button" value="Generate Report" />
40
+ </fieldset>
41
+ </form>
42
+
43
+ <br style="clear: both;" />
44
+
45
+ <%- if @sessions -%>
46
+
47
+ <%- unless @sessions.blank? -%>
48
+ <%= render "traffic_summary_all" if params[:traffic_kind] == 'total' -%>
49
+ <%= render "traffic_summary_by_kind" if params[:traffic_kind] != 'all' -%>
50
+ <%= render 'visits_graph' -%>
51
+ <%= render 'keywords_graph' unless @keywords_series.blank? -%>
52
+ <%= render "top_referrers" unless @referrers_series.blank? -%>
53
+ <%- end -%>
54
+
55
+ <%= page_break -%>
56
+
57
+ <fieldset class="form_container">
58
+ <%= legend_tag pluralize(@sessions.count, "Recent Matching Visit"), :help => 'Shown below are a sample of the most recent visits matching your report criteria. Click on the "Details" link next to a visit for more detailed information.' -%>
59
+ <%= render 'sessions' -%>
60
+ </fieldset>
61
+
62
+ <%= render 'print_buttons' -%>
63
+
64
+ <%- end -%>
65
+
66
+ <%- end -%>
67
+
@@ -0,0 +1,5 @@
1
+ Date Site Visit Type Referral Type IP Address Pageviews Duration Referrer Keywords Entrance Page Exit Page
2
+ <%- @sessions.each do |session| -%>
3
+ <%= session.created_at.to_s(:short_date_time) -%> <%= session.site -%> <%= session.visit_type -%> <%= session.kind.titleize -%> <%= session.ip_address -%> <%= session.views_count -%> <%= session.hr_duration -%> <%= session.referrer -%> <%= session.referring_keywords -%> <%= session.entrance_page -%> <%= session.exit_page -%>
4
+
5
+ <%- end -%>
@@ -0,0 +1,47 @@
1
+ <%= Seer::init_visualization -%>
2
+
3
+ <%- title "Traffic Summary" -%>
4
+
5
+ <%- unless @sessions -%>
6
+ <div class="note"><span class="notification info"></span><p>This report provides a high-level overview of traffic for the selected site(s), including traffic by kind, total visits, top referring keywords, and top referring sites.</p></div>
7
+ <%- end -%>
8
+
9
+ <%- if @sites.size == 1 -%>
10
+ <p><b>No traffic data has been gathered yet. Please try again later.</b></p>
11
+ <%- else -%>
12
+ <form>
13
+ <fieldset class="form_container">
14
+ <%= legend_tag "Report Criteria" -%>
15
+ <div class="three_column">
16
+ <fieldset>
17
+ <label for="site">Site:</label><br />
18
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>
19
+ </fieldset>
20
+ </div>
21
+ <div class="three_column">
22
+ <fieldset>
23
+ <label for="time_period">Time Period:</label><br />
24
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>
25
+ </fieldset>
26
+ </div>
27
+ </fieldset>
28
+ <input type="submit" class="button" value="Generate Report" />
29
+ </form>
30
+ <%- end -%>
31
+
32
+ <br style="clear: both;" />
33
+
34
+ <%- if @sessions -%>
35
+ <%= render "traffic_summary_all" if params[:visit_kind] == 'all' -%>
36
+ <%= render "traffic_summary_by_kind" if params[:visit_kind] != 'all' -%>
37
+ <%= render 'visits_graph' -%>
38
+ <%= page_break -%>
39
+ <%= render 'keywords_graph' unless @keywords_series.blank? -%>
40
+ <%= render "top_referrers" unless @referrers_series.blank? -%>
41
+ <%= page_break -%>
42
+ <fieldset class="form_container">
43
+ <%= legend_tag "Recent Visits", :help => 'Shown below are the 25 most recent visits matching your report criteria. Click on the "Details" link next to a visit for more detailed information.' -%>
44
+ <%= render 'sessions' -%>
45
+ </fieldset>
46
+ <%= render 'print_buttons' -%>
47
+ <%- end -%>
@@ -0,0 +1,97 @@
1
+ <%= Seer::init_visualization -%>
2
+
3
+ <%- title "Intersite Traffic Report" -%>
4
+
5
+ <%- if @total_visits.blank? -%>
6
+ <div class="note"><span class="notification info"></span><p>This report shows traffic between different sites, e.g. a link from a local site to a corporate home page or from one local site to another.</p></div>
7
+ <%- end -%>
8
+
9
+ <%- if @sites.size == 1 -%>
10
+ <p><b>No traffic data has been gathered yet. Please try again later.</b></p>
11
+ <%- else -%>
12
+ <form>
13
+ <fieldset class="form_container">
14
+ <%= legend_tag "Report Criteria" -%>
15
+ <div class="three_column">
16
+ <fieldset>
17
+ <label for="site">Site:</label><br />
18
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>
19
+ </fieldset>
20
+ </div>
21
+ <div class="three_column">
22
+ <fieldset>
23
+ <label for="time_period">Time Period:</label><br />
24
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>
25
+ </fieldset>
26
+ </div>
27
+ <div class="three_column">
28
+ <fieldset>
29
+ <label for="visit_kind">Traffic Type:</label><br />
30
+ <%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
31
+ </fieldset>
32
+ </div>
33
+ </fieldset>
34
+ <input type="submit" class="button" value="Generate Report" />
35
+ </form>
36
+ <%- end -%>
37
+
38
+ <br style="clear: both;" />
39
+
40
+ <%- if ! params[:site].blank? && (@total_visits.blank? || @destinations_series.blank?) -%>
41
+ <p><b>No data matched your criteria.</b></p>
42
+ <%- elsif params[:site] -%>
43
+ <fieldset class="form_container">
44
+ <%= legend_tag "Total Intersite Referrals By Week", :help => "This graph shows the total number of clicks that resulted in traffic to other sites in the network. Click on a data point for more details." -%>
45
+ <br />
46
+ <div id="total_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
47
+ <%= Seer::visualize(
48
+ @total_visits,
49
+ :as => :line_chart,
50
+ :in_element => 'total_chart',
51
+ :series => {
52
+ :series_label => 'Referrals',
53
+ :data_label => 'short_date',
54
+ :data_method => 'clickthroughs',
55
+ :data_series => @total_visits_series
56
+ },
57
+ :chart_options => {
58
+ :height => 300,
59
+ :width => 900,
60
+ :axis_font_size => 11,
61
+ :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'],
62
+ :title => "",
63
+ :point_size => 5,
64
+ :legend => 'none'
65
+ }
66
+ )
67
+ -%>
68
+ </fieldset>
69
+
70
+ <fieldset class="form_container">
71
+ <%= legend_tag "Intersite Referral Destinations", :help => "This graph shows the destinations of links that visitors clicked through to other sites in the network. Click on a bar in the graph below for a count of visits sent to the corresponding site." -%>
72
+ <br />
73
+ <div id="destinations_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
74
+
75
+ <%= Seer::visualize(
76
+ @destinations_series,
77
+ :as => :bar_chart,
78
+ :in_element => 'destinations_chart',
79
+ :series => {:series_label => 'site', :data_method => 'clickthroughs'},
80
+ :chart_options => {
81
+ :height => @destinations_series.size * 20,
82
+ :width => 900,
83
+ :is_3_d => false,
84
+ :legend => 'none',
85
+ :colors => ["#7e7587"],
86
+ :title => "# Referrals by Destination",
87
+ :title_font_size => 9,
88
+ :title_x => '',
89
+ :axis_font_size => 10
90
+ }
91
+ )
92
+ -%>
93
+ </fieldset>
94
+
95
+ <%= render 'print_buttons' -%>
96
+
97
+ <%- end -%>
@@ -0,0 +1,98 @@
1
+ <%- set_title "Leads Report" -%>
2
+
3
+ <%- if @leads.blank? -%>
4
+ <div class="note"><span class="notification info"></span><p>This report shows the total number of visits that resulted in leads for the specified site(s), time period, and traffic type, as well as the overall conversion rate.<br />(Note that in this case 'leads' refers to contact forms submitted.)</p></div>
5
+ <%- end -%>
6
+
7
+ <%- if @sites.size == 1 -%>
8
+ <p><b>No traffic data has been gathered yet. Please try again later.</b></p>
9
+ <%- else -%>
10
+ <form>
11
+ <fieldset class="form_container">
12
+ <%= legend_tag "Report Criteria" -%>
13
+ <div class="three_column">
14
+ <fieldset>
15
+ <label for="site">Site:</label><br />
16
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>
17
+ </fieldset>
18
+ </div>
19
+ <div class="three_column">
20
+ <fieldset>
21
+ <label for="time_period">Time Period:</label><br />
22
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>
23
+ </fieldset>
24
+ </div>
25
+ <div class="three_column">
26
+ <fieldset>
27
+ <label for="visit_kind">Traffic Type:</label><br />
28
+ <%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
29
+ </fieldset>
30
+ </div>
31
+ </fieldset>
32
+ <input type="submit" class="button" value="Generate Report" />
33
+ </form>
34
+ <%- end -%>
35
+
36
+ <%- unless @leads.blank? -%>
37
+
38
+ <br style="clear: both;" />
39
+
40
+ <%= Seer::init_visualization -%>
41
+
42
+ <fieldset class="form_container">
43
+ <%= legend_tag "Number Leads By Week (#{params[:time_period].titleize})", :help => 'This graph shows the number of leads submitted per week for the specified time period. Click on a data point for a count of leads for the corresponding week.' -%>
44
+ <br />
45
+ <div id="leads_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
46
+ <%= Seer::visualize(
47
+ @leads,
48
+ :as => :line_chart,
49
+ :in_element => 'leads_chart',
50
+ :series => {
51
+ :series_label => 'Leads',
52
+ :data_label => 'short_date',
53
+ :data_method => 'leads',
54
+ :data_series => @leads_series
55
+ },
56
+ :chart_options => {
57
+ :height => 300,
58
+ :width => 900,
59
+ :axis_font_size => 11,
60
+ :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'],
61
+ :title => "",
62
+ :point_size => 5,
63
+ :legend => 'none'
64
+ }
65
+ )
66
+ -%>
67
+ </fieldset>
68
+
69
+ <fieldset class="form_container">
70
+ <%= legend_tag "Visit-to-Lead Conversion Rate (#{params[:time_period].titleize})", :help => 'This graph shows the overall conversion rate week-over-week, which is the percentage of visits that resulted in a lead being submitted. Click on a data point for the conversion rate for the corresponding week.' -%>
71
+ <br />
72
+ <div id="conversions_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
73
+ <%= Seer::visualize(
74
+ @leads,
75
+ :as => :line_chart,
76
+ :in_element => 'conversions_chart',
77
+ :series => {
78
+ :series_label => 'Conversion Rate',
79
+ :data_label => 'short_date',
80
+ :data_method => 'conversion_rate',
81
+ :data_series => @leads_series
82
+ },
83
+ :chart_options => {
84
+ :height => 300,
85
+ :width => 900,
86
+ :axis_font_size => 11,
87
+ :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'],
88
+ :title => "",
89
+ :point_size => 5,
90
+ :legend => 'none'
91
+ }
92
+ )
93
+ -%>
94
+ </fieldset>
95
+
96
+ <%= render 'print_buttons' -%>
97
+
98
+ <%- end -%>
@@ -0,0 +1,113 @@
1
+ <%- title 'Session Details' -%>
2
+
3
+ <fieldset class="form_container">
4
+ <%= legend_tag "Session Details" -%>
5
+ <div class="three_column">
6
+ <fieldset>
7
+ <label>Site:</label><br />
8
+ <div class="faux_field"><%=h @trackable_session.site %></div>
9
+ </fieldset>
10
+ <fieldset>
11
+ <label>Kind:</label><br />
12
+ <div class="faux_field"><%=h @trackable_session.kind.titleize %></div>
13
+ </fieldset>
14
+ <fieldset>
15
+ <label>Visit Type:</label><br />
16
+ <div class="faux_field"><%=h @trackable_session.visit_type %></div>
17
+ </fieldset>
18
+ <fieldset>
19
+ <label>Date:</label><br />
20
+ <div class="faux_field"><%=h @trackable_session.created_at.to_s(:date_time) %></div>
21
+ </fieldset>
22
+ </div>
23
+ <div class="three_column">
24
+ <fieldset>
25
+ <label>Initial Referrer:</label><br />
26
+ <div class="faux_field"><%=h @trackable_session.referrer || 'None' %></div>
27
+ </fieldset>
28
+ <fieldset>
29
+ <label>Referring Keywords:</label><br />
30
+ <div class="faux_field"><%=h @trackable_session.referring_keywords.blank? ? 'None' : @trackable_session.referring_keywords %></div>
31
+ </fieldset>
32
+ <fieldset>
33
+ <label>Lead Generated:</label><br />
34
+ <div class="faux_field"><%=h @trackable_session.has_conversions? ? 'Yes' : 'No' %></div>
35
+ </fieldset>
36
+ </div>
37
+ <div class="three_column">
38
+ <fieldset>
39
+ <label>Pageviews:</label><br />
40
+ <div class="faux_field"><%= @trackable_session.pageviews -%></div>
41
+ </fieldset>
42
+ <fieldset>
43
+ <label>Visit Length:</label><br />
44
+ <div class="faux_field"><%=h @trackable_session.hr_duration %></div>
45
+ </fieldset>
46
+ <fieldset>
47
+ <label>Entrance Page:</label><br />
48
+ <div class="faux_field"><%=h @trackable_session.entrance_page %></div>
49
+ </fieldset>
50
+ <fieldset>
51
+ <label>Exit Page:</label><br />
52
+ <div class="faux_field"><%=h @trackable_session.exit_page %></div>
53
+ </fieldset>
54
+ </div>
55
+ </fieldset>
56
+
57
+ <fieldset class="form_container">
58
+ <%= legend_tag "Visitor Profile" -%>
59
+ <div class="three_column">
60
+ <fieldset>
61
+ <label>IP Address:</label><br />
62
+ <div class="faux_field"><%=h @trackable_session.ip_address %></div>
63
+ </fieldset>
64
+ <fieldset>
65
+ <label>Location:</label><br />
66
+ <div class="faux_field"><%=h @trackable_session.location ? @trackable_session.location : "Unknown" -%></div>
67
+ </fieldset>
68
+ </div>
69
+ <div class="three_column">
70
+ <fieldset>
71
+ <label># Previous Visits:</label><br />
72
+ <div class="faux_field"><%=h @trackable_session.previous_visits_count %></div>
73
+ </fieldset>
74
+ <fieldset>
75
+ <label>Last Visit:</label><br />
76
+ <div class="faux_field"><%=h @trackable_session.last_visit_date ? @trackable_session.last_visit_date : "Never" %></div>
77
+ </fieldset>
78
+ </div>
79
+ <div class="three_column">
80
+ <fieldset>
81
+ <label>Search Engine Spider?</label><br />
82
+ <div class="faux_field"><%= @trackable_session.spider? ? "Yes" : "No" -%></div>
83
+ </fieldset>
84
+ <fieldset>
85
+ <label>Browser:</label><br />
86
+ <div class="faux_field"><%=h @trackable_session.parsed_user_agent -%></div>
87
+ </fieldset>
88
+ </div>
89
+ </fieldset>
90
+
91
+ <fieldset class="form_container">
92
+ <%= legend_tag "User Actions" -%>
93
+ <table class="standard">
94
+ <thead>
95
+ <th>Time</th>
96
+ <th>URL</th>
97
+ <th>Action</th>
98
+ </thead>
99
+ <tbody>
100
+ <%- @trackable_session.trackable_actions.each do |action| -%>
101
+ <tr class="<%= cycle('odd', 'even') -%>">
102
+ <td><%= action.created_at.to_s(:time) -%></td>
103
+ <td><%= action.url -%></td>
104
+ <td><%= action.label -%></td>
105
+ </tr>
106
+ <%- end -%>
107
+ </tbody>
108
+ </table>
109
+ </fieldset>
110
+
111
+ <%= link_to 'Back', :back, :class => :button %>
112
+
113
+ <br style="clear: both;" />
@@ -0,0 +1,114 @@
1
+ <%- set_title "Visitor Profile Report" -%>
2
+
3
+ <%- unless @report -%>
4
+ <div class="note"><span class="notification info"></span><p>This report provides information about visitors to the specified site(s), time period, and traffic type, as well as the overall conversion rate.</p></div>
5
+ <%- end -%>
6
+
7
+ <%- if @sites.size == 1 -%>
8
+ <p><b>No traffic data has been gathered yet. Please try again later.</b></p>
9
+ <%- else -%>
10
+ <form>
11
+ <fieldset class="form_container">
12
+ <%= legend_tag "Report Criteria" -%>
13
+ <div class="three_column">
14
+ <fieldset>
15
+ <label for="site">Site:</label><br />
16
+ <%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>
17
+ </fieldset>
18
+ </div>
19
+ <div class="three_column">
20
+ <fieldset>
21
+ <label for="time_period">Time Period:</label><br />
22
+ <%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>
23
+ </fieldset>
24
+ </div>
25
+ <div class="three_column">
26
+ <fieldset>
27
+ <label for="visit_kind">Traffic Type:</label><br />
28
+ <%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
29
+ </fieldset>
30
+ </div>
31
+ </fieldset>
32
+ <input type="submit" class="button" value="Generate Report" />
33
+ </form>
34
+ <%- end -%>
35
+
36
+ <%- if @report -%>
37
+
38
+ <br style="clear: both;" />
39
+
40
+ <%= Seer::init_visualization -%>
41
+
42
+ <fieldset class="form_container">
43
+ <%= legend_tag "Top User Agents", :help => 'This graph shows the number of visitors by browser type. Note that "unknown" probably indicates a visit by a search engine spider. Click on a bar in the graph for the exact count of visits for a particular browser.' -%>
44
+ <br />
45
+ <div id="user_agents_chart" class="chart" style="width: 100%; border: 1px solid #999999; background-color: #ffffff; text-align: center;"></div>
46
+
47
+ <%= Seer::visualize(
48
+ @user_agents_series,
49
+ :as => :bar_chart,
50
+ :in_element => 'user_agents_chart',
51
+ :series => {:series_label => 'user_agent', :data_method => 'count'},
52
+ :chart_options => {
53
+ :height => @user_agents_series.size * 20,
54
+ :width => 900,
55
+ :is_3_d => false,
56
+ :legend => 'none',
57
+ :colors => ["#7e7587"],
58
+ :title => "Visit Count by Browser",
59
+ :title_font_size => 9,
60
+ :title_x => '',
61
+ :axis_font_size => 10
62
+ }
63
+ )
64
+ -%>
65
+ </fieldset>
66
+
67
+ <fieldset class="form_container">
68
+ <%= legend_tag "Top Visitor Locations", :help => 'The map below is a geographical representation of where visitors to the selected site(s) are coming from. The size and darkness of each point on the map corresponds to the number of visits from that location. Click on a point on the map for the name of the location and the number of visits that originated from that location.' -%>
69
+ <br />
70
+ <div class="chart" style="border: 1px solid #999999;">
71
+ <div id="map_chart" style="width: 100%; background-color: #ecf7fe; text-align: center; padding-top: 1em; padding-bottom: 1em;"></div>
72
+ <div id="locations_chart" style="width: 100%; background-color: #ffffff; text-align: center; padding-top: 1em; padding-bottom: 1em;"></div>
73
+ </div>
74
+ <%= Seer::visualize(
75
+ @locations_series,
76
+ :as => :bar_chart,
77
+ :in_element => 'locations_chart',
78
+ :series => {:series_label => 'sanitized_name', :data_method => 'count'},
79
+ :chart_options => {
80
+ :height => @locations_series.size * 20,
81
+ :width => 900,
82
+ :is_3_d => false,
83
+ :legend => 'none',
84
+ :colors => ["#7e7587"],
85
+ :title => "Visit Count by Location",
86
+ :title_font_size => 9,
87
+ :title_x => '',
88
+ :axis_font_size => 10
89
+ }
90
+ )
91
+ -%>
92
+
93
+ <%= Seer::visualize(
94
+ @locations_series,
95
+ :as => :geomap,
96
+ :in_element => 'map_chart',
97
+ :series => {
98
+ :series_label => 'sanitized_name',
99
+ :data_label => '# Visits',
100
+ :data_method => 'count'
101
+ },
102
+ :chart_options => {
103
+ :data_mode => 'markers',
104
+ :region => 'us_metro',
105
+ :colors => ['#bdadce','#7e7587']
106
+ }
107
+ )
108
+ -%>
109
+
110
+ </fieldset>
111
+
112
+ <%= render 'print_buttons' -%>
113
+
114
+ <%- end -%>