<%- set_title "Leads Report" -%> <%- if @leads.blank? -%>

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.
(Note that in this case 'leads' refers to contact forms submitted.)

<%- end -%> <%- if @sites.size == 1 -%>

No traffic data has been gathered yet. Please try again later.

<%- else -%>
<%= legend_tag "Report Criteria" -%>

<%= select_tag "site", options_for_select(@sites, params[:site] || "All Sites") -%>

<%= select_tag "time_period", options_for_select(@time_periods, params[:time_period].titleize) -%>

<%= select_tag "visit_kind", options_for_select(TrackableSession.kinds_for_select, params[:visit_kind] || "All") -%>
<%- end -%> <%- unless @leads.blank? -%>
<%= Seer::init_visualization -%>
<%= 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.' -%>
<%= Seer::visualize( @leads, :as => :line_chart, :in_element => 'leads_chart', :series => { :series_label => 'Leads', :data_label => 'short_date', :data_method => 'leads', :data_series => @leads_series }, :chart_options => { :height => 300, :width => 900, :axis_font_size => 11, :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'], :title => "", :point_size => 5, :legend => 'none' } ) -%>
<%= 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.' -%>
<%= Seer::visualize( @leads, :as => :line_chart, :in_element => 'conversions_chart', :series => { :series_label => 'Conversion Rate', :data_label => 'short_date', :data_method => 'conversion_rate', :data_series => @leads_series }, :chart_options => { :height => 300, :width => 900, :axis_font_size => 11, :colors => ['#7e7587','#7e7e00','#007e7e','#7e0000', '#007e00'], :title => "", :point_size => 5, :legend => 'none' } ) -%>
<%= render 'print_buttons' -%> <%- end -%>