Abuja Digital Studio · Est. 2018
Start a Project
DocsOOnboardProgress, analytics, embedding
Reference

Progress, analytics, embedding

OOnboardorravo.com/docs/oonboard/analytics-embed

Progress, analytics, embedding

Progress tracking

OOB_Progress persists where each user is in each flow (wp_oob_progress).

php// Has the user completed this flow?
$done = OOB_Progress::has_completed( $flow_id, $user_id );

// Helper that defaults to current user
$done = oob_has_completed_flow( $flow_id );

// Current step index
$idx = OOB_Progress::get_current_step( $flow_id, $user_id );

// Reset (replay the flow)
OOB_Progress::reset( $flow_id, $user_id );

Analytics

OOB_Analytics aggregates wp_oob_events rows for the per-flow conversion report.

php$report = OOB_Analytics::get_report( $flow_id );
// [
//   'started'         => int,
//   'completed'       => int,
//   'completion_rate' => float, // 0.0 - 1.0
//   'steps'           => [
//     [ 'step_index' => 0, 'views' => 210, 'completions' => 198, 'drop_rate' => 0.057 ],
//     ...
//   ],
// ]

$ab = OOB_Analytics::get_ab_comparison( $flow_id );

Shortcode

[oonboard id="5"]
[oonboard id="5" style="modal" button_label="Get Started"]
AttributeDefaultDescription
idrequiredFlow ID
styleinlineinline or modal
button_labelGet StartedLabel for modal trigger
class(empty)CSS class on the wrapper

Gutenberg block

oonboard/flow is registered with a server-side render_callback so the block stays in sync if the flow changes. Pick a flow in the block inspector.

Frontend engine endpoints

The runtime is entirely AJAX (both logged-in and nopriv variants, since flows can run on the registration page itself).

POST wp_ajax[_nopriv]_oob_get_flow_init   { flow_id }   → first step
POST wp_ajax[_nopriv]_oob_get_step        { flow_id, step_index }
POST wp_ajax[_nopriv]_oob_complete_step   { flow_id, step_index, answers }
POST wp_ajax[_nopriv]_oob_skip_step       { flow_id, step_index }
POST wp_ajax[_nopriv]_oob_abandon_flow    { flow_id }
POST wp_ajax[_nopriv]_oob_checklist_mark  { checklist_id, item_id }

All endpoints validate the oob_frontend nonce and return JSON.

Developer hooks

phpadd_action( 'oob_flow_started',   function( int $flow_id, int $user_id ) {} );
add_action( 'oob_step_completed', function( int $flow_id, int $step_index, int $user_id, array $answers ) {} );
add_action( 'oob_step_skipped',   function( int $flow_id, int $step_index, int $user_id ) {} );
add_action( 'oob_flow_abandoned', function( int $flow_id, int $user_id ) {} );

add_filter( 'oob_step_data',          function( array $step, int $flow_id, int $user_id ): array { return $step; }, 10, 3 );
add_filter( 'oob_save_answers',       function( array $answers, int $flow_id, int $step_index ): array { return $answers; }, 10, 3 );
add_filter( 'oob_redirect_url',       function( string $url, int $flow_id, int $user_id ): string { return $url; }, 10, 3 );
add_filter( 'oob_completion_actions', function( array $actions, int $flow_id, int $user_id ): array { return $actions; }, 10, 3 );
Progress, analytics, embedding · OOnboard Docs | Orravo