Back to Actions

Updated on Jun 08, 2024

slimstat_track_success

This action is triggered after WP Slimstat successfully tracks a new event.

do_action('slimstat_track_success');

In simple terms:

  1. slimstat_track_success is an action hook provided by the WP Slimstat plugin.
  2. It fires (runs) right after WP Slimstat successfully tracks a new event on your website.
  3. An “event” could be a pageview, a click, or any other action that WP Slimstat is set up to track.
  4. You can use this hook to run your own custom functions or code whenever an event is tracked.
  5. This is useful if you want to do something extra every time a visitor interacts with your site in a way that WP Slimstat tracks.

For example, you might use this hook to:

  • Log additional information to a custom database.
  • Send a notification to an external service.
  • Update a cache or perform some cleanup tasks.

Remember, to use this hook, you need to write a function that does what you want, and then “hook” that function to slimstat_track_success using add_action(), as shown in the example.
Example usage:

add_action('slimstat_track_success', 'my_function_after_tracking');
function my_function_after_tracking() {
      // Your code here
}