1 ) ); }
list( $aieo_st_open, $aieo_st_close ) = AIEO_DMM_UI::card( array(
'anchor' => 'session-tracker',
'icon' => 'lock',
'title' => __( 'What is recorded', 'ai-eshop-optimizer' ),
'description' => __( 'Traditional analytics platforms charge $100+ monthly for BigQuery exports and bury you in irrelevant data. Our AI Session Tracker captures only the critical eCommerce signals that drive sales and power intelligent AI recommendations.', 'ai-eshop-optimizer' ),
'footer' => $is_pro_user_session ? '' : '',
) );
echo $aieo_st_open;
?>
' . esc_html__('Privacy and GDPR:', 'ai-eshop-optimizer') . ' ' . esc_html__('Automatically integrates with CookieYes, Cookie Notice, and Complianz consent plugins. No personal data or coordinates are tracked.', 'ai-eshop-optimizer'),
'mono',
array( 'inline' => true )
);
echo $aieo_st_privacy;
if ( ! $is_pro_user_session ) :
$aieo_st_pro = \Rooster\Admin\States::state( 'pro', array(
'feature' => __( 'AI Session Tracker', 'ai-eshop-optimizer' ),
'pro' => __( 'Rooster One Pro', 'ai-eshop-optimizer' ),
'text' => __( 'Our tracker captures only what drives sales - engagement depth, product interactions, and cart behavior - metrics Google doesn\'t even provide clearly. Zero bloat. Zero cost. Maximum insight.', 'ai-eshop-optimizer' ),
'href' => 'https://rooster.systems/get-rooster-one-pro/',
'label' => __( 'Upgrade to Pro', 'ai-eshop-optimizer' ),
) );
echo $aieo_st_pro;
else :
$aieo_st_switch = static function ( $name, $on, $label, $control_label, $opts = array() ) {
return \Rooster\Admin\Ui::field_row( array(
'id' => $name,
'label' => $label,
'control' => \Rooster\Admin\Ui::toggle( $name, (bool) $on, array( 'id' => $name, 'hidden' => false, 'label' => $control_label ) ),
) + $opts );
};
$aieo_st_hours = array();
for ( $aieo_st_h = 0; $aieo_st_h < 24; $aieo_st_h++ ) {
$aieo_st_hours[ (string) $aieo_st_h ] = sprintf( '%02d:00', $aieo_st_h );
}
$aieo_st_rows = '';
$aieo_st_rows .= $aieo_st_switch( 'aieo_session_tracking_enabled', get_option( 'aieo_session_tracking_enabled', 0 ), __( 'Enable session tracking', 'ai-eshop-optimizer' ), __( 'Enabled', 'ai-eshop-optimizer' ) );
$aieo_st_rows .= $aieo_st_switch( 'aieo_track_scroll_depth', get_option( 'aieo_track_scroll_depth', 1 ), __( 'Track scroll depth', 'ai-eshop-optimizer' ), __( 'Track engagement (25%, 50%, 75%, 100%)', 'ai-eshop-optimizer' ) );
$aieo_st_rows .= $aieo_st_switch( 'aieo_track_clicks', get_option( 'aieo_track_clicks', 1 ), __( 'Track clicks', 'ai-eshop-optimizer' ), __( 'Track clicks on buttons and links', 'ai-eshop-optimizer' ) );
$aieo_st_rows .= $aieo_st_switch( 'aieo_throttle_clicks', get_option( 'aieo_throttle_clicks', 1 ), __( 'Throttle click events', 'ai-eshop-optimizer' ), __( 'Throttle click event tracking to prevent flooding (recommended)', 'ai-eshop-optimizer' ) );
$aieo_st_rows .= $aieo_st_switch(
'aieo_session_bypass_consent',
get_option( 'aieo_session_bypass_consent', 1 ),
__( 'Cookie consent', 'ai-eshop-optimizer' ),
__( 'Bypass cookie consent requirement (enable tracking without waiting for user consent)', 'ai-eshop-optimizer' ),
array( 'attrs' => \Rooster\Admin\Guidance::role( 'essential' ) )
);
$aieo_st_rows .= \Rooster\Admin\Ui::field_row( array(
'id' => 'aieo_session_archive_frequency',
'label' => __( 'Archive frequency', 'ai-eshop-optimizer' ),
'control' => \Rooster\Admin\Ui::select(
'aieo_session_archive_frequency',
array(
'daily' => __( 'Daily', 'ai-eshop-optimizer' ),
'weekly' => __( 'Weekly', 'ai-eshop-optimizer' ),
'monthly' => __( 'Monthly', 'ai-eshop-optimizer' ),
),
(string) get_option( 'aieo_session_archive_frequency', 'weekly' ),
array( 'id' => 'aieo_session_archive_frequency' )
),
'help' => __( '(default: Weekly)', 'ai-eshop-optimizer' ),
) );
$aieo_st_rows .= \Rooster\Admin\Ui::field_row( array(
'id' => 'aieo_session_archive_hour',
'label' => __( 'Archive hour (GMT)', 'ai-eshop-optimizer' ),
'control' => \Rooster\Admin\Ui::select( 'aieo_session_archive_hour', $aieo_st_hours, (string) (int) get_option( 'aieo_session_archive_hour', 4 ), array( 'id' => 'aieo_session_archive_hour' ) ),
'help' => __( '(default: 04:00)', 'ai-eshop-optimizer' ),
) );
$aieo_st_rows .= \Rooster\Admin\Ui::field_row( array(
'id' => 'aieo_session_retention_days',
'label' => __( 'Data retention', 'ai-eshop-optimizer' ),
'control' => \Rooster\Admin\Ui::input( 'aieo_session_retention_days', (string) (int) get_option( 'aieo_session_retention_days', 30 ), array( 'id' => 'aieo_session_retention_days', 'type' => 'number', 'xs' => true, 'min' => 7, 'max' => 90, 'step' => 1, 'unit' => __( 'days', 'ai-eshop-optimizer' ) ) ),
'help' => __( '(7-90 days, default: 30)', 'ai-eshop-optimizer' ),
) );
$aieo_st_rules_help = esc_html__( 'Track clicks on custom elements. One rule per line in format:', 'ai-eshop-optimizer' )
. '
event_name | .css-selector
'
. esc_html__( 'Works for ANY element (images, buttons, divs, etc.). Only active on product pages.', 'ai-eshop-optimizer' )
. '
' . esc_html__( 'Example:', 'ai-eshop-optimizer' )
. '
variation_swatch | .merchant-variation-item
color_picker | .color-swatch
size_button | .size-selector';
$aieo_st_rows .= \Rooster\Admin\Ui::field_row( array(
'id' => 'aieo_custom_image_click_rules',
'label' => __( 'Custom image click rules', 'ai-eshop-optimizer' ),
'control' => \Rooster\Admin\Ui::textarea( 'aieo_custom_image_click_rules', (string) get_option( 'aieo_custom_image_click_rules', '' ), array( 'id' => 'aieo_custom_image_click_rules', 'rows' => 6, 'code' => true ) ),
'help_html' => $aieo_st_rules_help,
) );
?>