array(), 'builtin' => array() ); $nonce = isset( $nonce ) ? $nonce : wp_create_nonce( 'aieo_dmm_nonce' ); $ajax = isset( $ajax ) ? $ajax : admin_url( 'admin-ajax.php' ); ?> 'conversion-goals-overview', 'title' => __( 'Goals from forms and actions', 'ai-eshop-optimizer' ), 'description' => __( 'What counts as a CONVERSION on this site — a site can have several. Pick the exact Gravity Forms whose submission is a goal; Newsletter signups are covered by our Newsletter-plugin integration below. Each conversion is recorded (consent-gated) into the session stream, attributed to its page, and folded into content engagement/demand exactly like add-to-cart is for shops. "Analyse" reads the form’s fields with AI and stores its goal context — the SEO write queue then writes titles/descriptions toward that actual conversion.', 'ai-eshop-optimizer' ), 'footer' => \Rooster\Admin\States::save_button( $aieo_cg_form_id, array( 'label' => __( 'Save goals', 'ai-eshop-optimizer' ) ) ), ) ); echo $aieo_cg_open; ob_start(); ?> __( 'Gravity Forms not detected — form goals need it (the supported form provider).', 'ai-eshop-optimizer' ), 'compact' => true, ) ); echo $aieo_cg_none; ?> $gf ) { $saved = isset( $goal_config['forms'][ $gk ] ) ? $goal_config['forms'][ $gk ] : array(); $aieo_cg_rows[] = array( 'key' => (string) $gk, 'provider' => (string) $gf['provider'], 'form_id' => (int) $gf['form_id'], 'title' => (string) ( $gf['title'] ?: ( '#' . $gf['form_id'] ) ), 'source' => $gf['provider'] . ' #' . $gf['form_id'], 'label' => (string) ( $saved['label'] ?? '' ), 'context' => (string) ( $saved['context'] ?? '' ), 'on' => ! empty( $saved['on'] ), ); } AIEO_Table::render( array( 'id' => 'aieo-goal-forms', 'columns' => array( array( 'key' => 'on', 'label' => __( 'Goal?', 'ai-eshop-optimizer' ), 'type' => 'control', 'width' => '60px', 'format' => array( 'render' => static function ( $row ) { return ''; }, ), ), array( 'key' => 'title', 'label' => __( 'Form', 'ai-eshop-optimizer' ), 'type' => 'control', 'width' => '260px', 'format' => array( 'render' => static function ( $row ) { $out = '' . esc_html( $row['title'] ) . '' . '
' . esc_html( $row['source'] ) . ''; if ( '' !== $row['label'] ) { $out .= '
' . \Rooster\Admin\Ui::badge( (string) $row['label'], 'primary', array( 'sm' => true ) ); } return $out; }, ), ), array( 'key' => 'context', 'label' => __( 'AI goal context (feeds the SEO writer)', 'ai-eshop-optimizer' ), 'type' => 'control', 'format' => array( 'render' => static function ( $row ) { return '' . esc_html( $row['context'] ) . '' . ''; }, ), ), array( 'key' => 'analyse', 'label' => '', 'type' => 'control', 'width' => '110px', 'format' => array( 'render' => static function ( $row ) { return \Rooster\Admin\Guidance::row_buttons( array( array( 'label' => __( 'Analyse', 'ai-eshop-optimizer' ), 'attrs' => array( 'data-goal-analyze' => '1' ) ) ), (string) $row['title'] ); }, ), ), ), 'rows' => $aieo_cg_rows, 'row_key' => 'key', 'row_data' => array( 'key' => 'key', 'provider' => 'provider', 'form' => 'form_id', ), 'page_id' => 'conversion_goals', ) ); ?>
'number', 'short' => true, 'unit' => $aieo_cg_sym, 'min' => 0, 'step' => 'any', 'class' => 'aieo-goal-value', 'id' => 'aieo-cg-worth-' . $bk, 'aria-label' => __( 'Worth of one', 'ai-eshop-optimizer' ) . ': ' . $aieo_cg_label, 'attrs' => array( 'data-key' => $bk ), ) ); $aieo_cg_control = ob_get_clean(); echo \Rooster\Admin\Ui::field_row( array( 'label' => $aieo_cg_label, 'group' => true, 'id' => 'aieo-cg-' . $bk, 'control' => '
' . $aieo_cg_control . '
', 'help' => 'product_request_item' === $bk ? __( 'Off by default on purpose: a quote grows, so counting each added product books one lead several times.', 'ai-eshop-optimizer' ) : '', 'help_id' => 'aieo-cg-product-request-item-help', ) ); ?>

AIEO_DMM::MENU_SLUG, 'dmm_tab' => 'form_insights' ), admin_url( 'admin.php' ) ); echo \Rooster\Admin\States::form( $aieo_cg_form_id, (string) ob_get_clean() ); ?> ', '' ) ); echo \Rooster\Admin\Guidance::text( wp_strip_all_tags( $aieo_cg_where ), 'guidance', array( 'html' => $aieo_cg_where, 'question' => __( 'Where do I read them?', 'ai-eshop-optimizer' ) ) ); ?>