39. Analytics | Form Forge - Build Forms with AI in Seconds
Download Log in

39. Analytics

Developer Guide

Tracks form views, persisted submissions, and abandonments. PRO feature.

Event Types

EventWhen TrackedTrigger Location
viewForm is renderedFORMFORGE_Form_Renderer::render()
submitSubmission savedFORMFORGE_Form_Handler::handle_submit()
abandonPartial data savedFORMFORGE_Abandonment::ajax_save_partial()

Querying Stats

php
$stats = FORMFORGE_Analytics::instance()->get_stats( $form_id );
// [ "views" => 1250, "submissions" => 87, "conversion_rate" => 6.96 ]
get_stats() intentionally counts submissions from completed rows in wp_formforge_submissions (status 'abandoned') and uses wp_formforge_analytics only for view events. This keeps the All Forms responses column, Analytics dashboard, and Submissions page consistent even if an old or diagnostic submit event exists without a matching saved submission. Abandoned rows are reported only through the Abandoned metric.

Conversion Rate Caching

Results are cached for 5 minutes via WordPress transients:

php
$cache_key = 'ff_stats_v2_' . $form_id . '_' . $days;
set_transient( $cache_key, $stats, 5 * MINUTE_IN_SECONDS );

Forge AI Assistant Online

Hi! I'm the Form Forge AI assistant. Ask me anything about the plugin — setup, features, troubleshooting, or development.

Just now
Powered by Forge AI · Browse docs