Segment For WordPress


Segment Analytics for WordPress. Free WooCommerce, Ninja Form & Gravity Form integrations.
Uses Segment’s official PHP libraries for Server Side events, as well as a lot of other features functionality.
I completely rewrote this plugin from the previous version.
Client side and server side tracking.
Client side events fire upon validation (ie, for submissions)
Server side events are scheduled and happen asynchronously, so users don’t have to wait for processing of these events, it won’t slow them down.

There are annotations throughout the plugin to explain the different features.

  • Set a User ID based on user custom field, email, or WP user id
  • Built-in support for WooCommerce, Ninja Forms, Gravity Forms and WordPress native events.
  • Re-name events, choose what traits to include in Identify calls, etc…
  • Supports client side (JS API) and server-side tracking (PHP API)
  • Ability to filter out roles, custom post types and the admin area
  • Easily include userID and email properties in track calls
  • Ability to include custom user traits in identify calls using meta keys


You can use the following filters, please return the correct values.

  • “segment_for_wp_change_user_id” ($user_id): Return a user id.
  • “segment_for_wp_change_user_traits” ($traits, $wp_user_id): Return an associative array of traits.
  • “segment_for_wp_change_event_properties” ($properties, $action, $data): Return an associative array of properties.
  • “segment_for_wp_change_product_properties” ($properties): Return an associative array of product properties (for WooCommerce).
  • “segment_for_wp_change_order_properties” ($properties): Return an associative array of order properties (for WooCommerce).

Happy to extend it, let me know.


  • Supports client side (JS API) and server-side tracking (PHP API)
  • Ability to filter out roles, custom post types and the admin area
  • Easily include userID and email properties
  • Many other options for Identify calls
  • Support for Ninja Forms and Gravity Forms
  • Supports WooCommerce events, you can re-name them and track them server side, etc...


  1. Upload the plugin zip file through the Plugins section of your site.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Enter your Segment API keys into the plugin and choose your events/settings.


  1. What do I need? You will need to signup for You will need a Segment JavaScript source and a PHP Source.
  2. How much does it cost? Plugin is free. Segment is free up to 1,000 users.
  3. Will it slow my site down? Depends. The more destinations and the more events you use, the slower things can go. The same way as if you installed the scripts directly.


24 de septiembre, 2021 1 reply
Setup your connection with Segment in a snap. Pass user IDs, traits, events without writing a single line of code. This plugin is gold
Read all 2 reviews

Contributors & Developers

“Segment For WordPress” is open source software. The following people have contributed to this plugin.




  • Fix error with flatten function on Server Side tracking


  • Include more pages in custom post meta functionality
  • Recursive check for string length of server side payload


  • Fix File consumer
  • Fix php warnings on plugin activation


  • Add server side Page tracking
  • Add support for more Gravity Form fields
  • Fix Ninja Forms server side tracking
  • Fix bugs with role filtering
  • Fix bug with some empty page names


  • Fix bug initialising plugin without write permissions for plugin folder
  • Handle critical error when Server side payload is greater than 8000 characters
  • Fix a bug with client side events for Gravity Forms


  • Let users increase Socket consumer timeout and cron job interval further (help support less powerful servers)


  • Fixes for Logged In event and fallback identify call


  • Adding filter hooks and hook documentation
  • Fixed User ID when default is selected.


  • Re-wrote the whole plugin. Much better now.
  • Now uses Segment’s official PHP Library for Server Side events
  • More advanced options and extra functionality. Pull data from user_meta, post_meta, etc… to populate identify calls, page calls and track calls.
  • Better implementation of client side tracking
  • Better performance and reliability
  • Made all of the server side tracking asynchronous


  • More updates to bring woocommerce integration inline with their ‘new’ functions vs legacy ones I used to begin with


  • Moving to new WooCommerce methods to get order data in order to avoid some error notices


  • Small Fixes


  • Fixed an bug with WC functions


  • Removed some unused functions, fixed a potential bug when reading ‘signed up’ cookies.


  • Updated README and made the plugin description more helpful


  • First version