extends Base_Object_With_Meta implements Event_Process
Represents a single step inside a funnel — an action, benchmark (trigger), timer, or logic step. Every step belongs to a funnel and has an ordered position within it. Use this class to inspect step configuration, navigate the funnel structure, or get the contacts currently waiting at this step.
Methods
| Method | Returns | Description |
|---|---|---|
get_id() | int | Returns the step ID. |
get_title() | string | Returns the step’s display title. |
get_type() | string | Returns the step type slug (e.g. 'send_email', 'apply_tag', 'form_filled'). |
get_type_name() | string | Returns the human-readable label for the step type. |
get_group() | string | Returns the step group: 'action', 'benchmark', 'logic', or 'timer'. |
get_order() | int | Returns the step’s position within the funnel. |
get_funnel_id() | int | Returns the ID of the funnel this step belongs to. |
get_funnel() | Funnel | Returns the Funnel object this step belongs to. |
is_action() | bool | Returns true if this is an action step. |
is_benchmark() | bool | Returns true if this is a benchmark (trigger) step. |
is_logic() | bool | Returns true if this is a logic step. |
is_conversion() | bool | Returns true if this step is flagged as a conversion step. |
is_entry() | bool | Returns true if this is an entry (first benchmark) step. |
is_last() | bool | Returns true if this is the last step in the funnel. |
type_is( string $type ) | bool | Returns true if the step’s type slug matches $type. |
get_waiting_contacts() | Contact[] | Returns an array of contacts currently waiting at this step. |
get_waiting_events() | Event[] | Returns an array of events currently waiting at this step. |
get_next_action( Contact $contact ) | Step|false | Returns the next action step that will run for the given contact. |
get_prev_action() | Step|false | Returns the preceding action step. |
get_preceding_steps() | Step[] | Returns all steps that precede this one in the funnel flow. |
get_proceeding_actions() | Step[] | Returns all action steps that follow this one. |
get_sub_steps() | Step[] | Returns child steps if this is a logic branch step. |
Usage
Here’s a pseudo code example for a hypothetical step analytics integration.
<?php
add_action( 'groundhogg/event/complete', 'my_plugin_log_step_completion' );
/**
* Log when a contact completes a step, with step type context.
*
* @param \Groundhogg\Event $event
*
* @return void
*/
function my_plugin_log_step_completion( $event ) {
$step = $event->get_step();
$contact = $event->get_contact();
if ( ! $step || ! $contact ) {
return;
}
my_plugin_record_completion( [
'contact_id' => $contact->get_id(),
'funnel_id' => $step->get_funnel_id(),
'step_id' => $step->get_id(),
'step_type' => $step->get_type(),
'step_group' => $step->get_group(),
'is_conversion' => $step->is_conversion(),
] );
}
Was this helpful?
Let us know if this document answered your question. That’s the only way we can improve.
