Docs
← Back to site

On a client’s WordPress (the connector)

2 min readUpdated November 22, 2026
// Joins the current visitor's visit (a membership plugin, a booking form, a payment hook…)
nahnu_analytics_track( 'Lead won', array(
    'props'   => array( 'plan' => 'pro' ),
    'revenue' => array( 'amount' => 490, 'currency' => 'USD' ),
) );

// Later, with no visitor around (a webhook, WP-Cron): pass their address and browser if you kept them
nahnu_analytics_track( 'Renewal', array( 'ip' => $saved_ip, 'user_agent' => $saved_ua, 'url' => home_url( '/account/' ) ) );

// Without depending on the connector being active
do_action( 'nahnu_analytics_track', 'Lead won', array( 'props' => array( 'plan' => 'pro' ) ) );
HookKindWhat for
nahnu_analytics_connector_eventfilterChange an event before it is sent; return false to drop it
nahnu_analytics_connector_event_sentactionAfter an event is sent
nahnu_analytics_connector_inline_jsfilterAdd a line to the footer snippet, for example for your own form plugin
nahnu_analytics_connector_skipfilterLeave a request out of counting (a staging host, a role of your own)
nahnu_analytics_connector_purchasefilterChange the WooCommerce Purchase event: add properties, or use net revenue
nahnu_analytics_connector_store_currencyfilterSupply the converted amount for a multi-currency plugin that is not supported
nahnu_analytics_connector_surecart_purchasefilterChange or skip the Purchase for a SureCart checkout
nahnu_analytics_connector_surecart_testfilterReturn true to count SureCart test-mode purchases
nahnu_analytics_connector_store_purchasefilterChange or skip a FluentCart or Easy Digital Downloads purchase
nahnu_analytics_connector_store_testfilterReturn true to count FluentCart and EDD test orders
nahnu_analytics_connector_consent_essentialfilterReturn false to let consent tools hold the stats back until a visitor agrees

Each store and consent filter is shown with an example in the Nahnu Analytics Connector for WordPress › WordPress integrations docs.

Was this helpful?