mb_substr( preg_replace( '/[^a-z0-9_]/', '', strtolower( sanitize_text_field( wp_unslash( $_POST['name'] ?? '' ) ) ) ), 0, 100 ), 'trigger' => in_array( $trigger, array( 'click', 'submit', 'pageview' ), true ) ? $trigger : 'click', 'selector' => sanitize_text_field( wp_unslash( $_POST['selector'] ?? '' ) ), 'match' => 'equals' === sanitize_key( wp_unslash( $_POST['match'] ?? '' ) ) ? 'equals' : 'contains', 'label_from' => in_array( $label_from, array( 'fixed', 'text', 'href', 'none' ), true ) ? $label_from : 'none', 'label' => sanitize_text_field( wp_unslash( $_POST['label'] ?? '' ) ), 'value' => is_numeric( $value ) ? (float) $value : null, 'enabled' => true, ); if ( '' === $rule['name'] || '' === $rule['selector'] ) { $error = 'Event name and selector (or URL) are required.'; } else { if ( null !== $index && isset( $rules[ $index ] ) ) { $rule['enabled'] = $rules[ $index ]['enabled']; $rules[ $index ] = $rule; } else { $rules[] = $rule; } update_option( 'footloom_event_rules', $rules ); } } elseif ( 'toggle_rule' === $action && isset( $rules[ $index ] ) ) { $rules[ $index ]['enabled'] = empty( $rules[ $index ]['enabled'] ); update_option( 'footloom_event_rules', $rules ); } elseif ( 'delete_rule' === $action && isset( $rules[ $index ] ) ) { unset( $rules[ $index ] ); $rules = array_values( $rules ); update_option( 'footloom_event_rules', $rules ); } if ( $error ) { echo '
' . esc_html( $error ) . '
Saved.
Track clicks, form submissions and page visits without writing code. Events show up on the dashboard and can be used as goals.
No custom events yet. Add your first one below.
| Event name | Trigger | Selector or URL | Last 7 days | Status | |
|---|---|---|---|---|---|
|
|
n : 0; ?> | Edit |
Send an event from your own JavaScript:
footloom.track('signup', { label: 'footer form', value: 1 });
Or add attributes to any element to track clicks on it:
<a href="/pricing.pdf" data-footloom-event="download" data-footloom-label="pricing.pdf">Download</a>
Link clicks to other websites (outbound_click) and form submissions (form_submit) are tracked automatically.