$len ) ? mb_substr( $text, 0, $len - 1, 'UTF-8' ) . '…' : $text; } return $text; }; $aieo_insight_bar = static function ( $pct ) { return number_format( max( 0, min( 100, (float) $pct ) ), 1, '.', '' ); }; ?> ' . $pointer . '

' : ''; list( $aieo_fi_open, $aieo_fi_close ) = AIEO_DMM_UI::card( array( 'anchor' => 'form-insights-what-your-leads-tell-you', 'icon' => 'message-square-text', 'title' => __( 'What your leads tell you', 'ai-eshop-optimizer' ), 'description' => __( 'A conversion goal counts how many leads arrived. It says nothing about who they are — yet the answer is already sitting in the entries. Every checkbox, radio button, dropdown and multi-select on a form is a segment the lead declared about themselves at the moment of highest intent. Read the breakdown below as the audience your ad copy, keywords and social targeting should be written for.', 'ai-eshop-optimizer' ), 'footer' => $aieo_fi_pointer, ) ); echo $aieo_fi_open; if ( class_exists( 'GFForms' ) || class_exists( 'GFAPI' ) ) { echo \Rooster\Admin\Ui::notice( esc_html__( 'Gravity Forms detected. Form insights are reading it directly, and nothing here needs setting up. Rooster One only reads: your forms, their fields and their entries stay exactly where they are, and are never modified.', 'ai-eshop-optimizer' ), 'success', array( 'inline' => true ) ); } ?> $title, 'text' => $text ) ); }; $aieo_fi_txt_none = __( 'This form has not been submitted yet. The breakdown appears as soon as the first entry lands — nothing is wrong, there is simply nobody to describe.', 'ai-eshop-optimizer' ); $aieo_fi_txt_nocnt = __( 'This form has entries but no questions with a countable answer, so there is nothing to break down. Choices, rating scales, star ratings, ranked lists and number fields are all summarised here; free-text and email answers deliberately are not.', 'ai-eshop-optimizer' ); $aieo_fi_txt_blank = __( 'This form has questions with a countable answer, but not one of them has been answered in any entry — every submission left them blank. Making one required, or moving it above the fold, is what turns this into a report.', 'ai-eshop-optimizer' ); $aieo_fi_txt_failed = __( 'Could not read that form.', 'ai-eshop-optimizer' ); ?> 'aieo-insight-form', 'medium' => true, 'attrs' => array( 'aria-describedby' => 'aieo-insight-status' ) ) ); ?>
array( 'id' => 'aieo-insight-refresh', 'aria-describedby' => 'aieo-insight-status' ) ) ); ?>
__( 'How are percentages counted?', 'ai-eshop-optimizer' ) ) ); echo \Rooster\Admin\Guidance::text( __( 'Rating questions are averaged only over the people who answered them: a blank is never counted as a zero, and the number of answers is printed beside every average so a score from nine people never reads like a score from nine hundred. Questions are grouped under the heading they were asked beneath, because that heading is usually where the question actually is.', 'ai-eshop-optimizer' ), 'guidance', array( 'question' => __( 'How are ratings averaged?', 'ai-eshop-optimizer' ) ) ); $aieo_fi_entries = $insight_report ? (int) ( isset( $insight_report['total_entries'] ) ? $insight_report['total_entries'] : 0 ) : 0; $aieo_fi_questions = ( $insight_report && ! empty( $insight_report['fields'] ) ) ? count( $insight_report['fields'] ) : 0; $aieo_fi_shown = $aieo_fi_entries > 0 && $aieo_fi_questions > 0; $aieo_fi_head = \Rooster\Admin\States::result_head( $aieo_fi_shown ? sprintf( _n( '%s entry', '%s entries', $aieo_fi_entries, 'ai-eshop-optimizer' ), number_format_i18n( $aieo_fi_entries ) ) : '', array( 'id' => 'aieo-insight-result', 'facts' => $aieo_fi_shown ? array( sprintf( _n( '%s question', '%s questions', $aieo_fi_questions, 'ai-eshop-optimizer' ), number_format_i18n( $aieo_fi_questions ) ) ) : array(), 'attrs' => $aieo_fi_shown ? array() : array( 'hidden' => true ), ) ); echo $aieo_fi_head; ?>
$insight_error ) ); elseif ( ! $insight_report ) : echo \Rooster\Admin\Ui::notice( esc_html__( 'Pick a form above to see how its leads answered.', 'ai-eshop-optimizer' ), 'info', array( 'inline' => true, 'icon' => '' ) ); elseif ( (int) $insight_report['total_entries'] < 1 ) : echo $aieo_fi_state( 'first-use', $aieo_fi_txt_none ); elseif ( empty( $insight_report['fields'] ) ) : $aieo_fi_silence = isset( $insight_report['computed_at'] ) ? $aieo_fi_state( 'first-use', $aieo_fi_txt_blank ) : $aieo_fi_state( 'not-set-up', $aieo_fi_txt_nocnt ); echo $aieo_fi_silence; else : require AIEO_DIR . 'assets/pages/dmm/form-insights-body.php'; endif; endif; ?>
'form-insights-pages', 'icon' => 'map-pin', 'title' => __( 'The pages it came from', 'ai-eshop-optimizer' ), 'description' => __( 'The pages this form was sent from, counted by Rooster One as each entry arrives, apart from the campaign reports.', 'ai-eshop-optimizer' ), ) ); echo $aieo_fi_pa_open; echo '
' . ( $insight_form_id > 0 ? AIEO_Page_Actions::form_pages( 'gravity_' . $insight_form_id ) : '' ) . '
'; echo $aieo_fi_pa_close; } ?> 'aieo_form_respondents_csv' ), admin_url( 'admin-post.php' ) ), 'aieo_form_respondents_csv' ); ?>