Events, filters and actions
Record your own events from PHP or the browser, and change or drop what the connector sends with filters.
From PHP#
Records an event for the current visitor. From a webhook or cron, pass ip and user_agent too.
nahnu_analytics_track( 'Lead won', array(
'props' => array( 'plan' => 'pro' ),
'revenue' => array( 'amount' => 490, 'currency' => 'USD' ),
) );
// The same, without checking that the plugin is active:
do_action( 'nahnu_analytics_track', 'Lead won', array( 'props' => array( 'plan' => 'pro' ) ) ); The event shows in the website’s Goals & events card with its revenue; pick a property under Properties to break it down.

In the browser#
In markup#
data-k-event="Name" on a link or button, with data-k-p-<prop>="value" for properties.
Filters#
| Filter | Use it to |
|---|---|
nahnu_analytics_connector_event | Change or drop any event before it is sent |
nahnu_analytics_connector_inline_js | Add your own form plugin’s success event (f(name, options) records one) |
nahnu_analytics_connector_skip | Leave a request out: no snippet, no events |
nahnu_analytics_connector_consent_essential | Return false to ask consent tools for consent first |
nahnu_analytics_connector_stats_cap | Who sees the Stats item (default manage_options) |
nahnu_analytics_connector_purchase | The WooCommerce Purchase event |
nahnu_analytics_connector_surecart_purchase, nahnu_analytics_connector_surecart_test | SureCart’s Purchase event; count test mode |
nahnu_analytics_connector_store_purchase, nahnu_analytics_connector_store_test | FluentCart and Easy Digital Downloads: the Purchase event (null leaves it out); count test mode |
nahnu_analytics_connector_store_currency | An order’s revenue in the store’s currency, for another multi-currency plugin |
nahnu_analytics_connector_trust_proxy, nahnu_analytics_connector_is_proxy, nahnu_analytics_connector_client_ip | Which forwarding headers are believed; whether the connecting address is a trusted proxy; the visitor address sent |
nahnu_analytics_connector_upstream | Where forwarded visits and the script come from |
nahnu_analytics_connector_indexnow_public, nahnu_analytics_connector_indexnow_endpoint | Whether this site’s address may go to IndexNow; the IndexNow address |
nahnu_analytics_connector_history_jetpack | Give Jetpack Stats’ answers instead of asking WordPress.com |
Example: a form plugin of your own.
Action#
nahnu_analytics_connector_event_sent fires after each event is sent.
Goals, funnels and journeys are set up in Nahnu Analytics (or its REST API), not in the connector.
Was this helpful?
Thanks for your feedback!
✓ Feedback received. Thank you!



