coresocial_tracking_recorded
This content is intended for WordPress developers, and it may require coding knowledge of WordPress, PHP, and JavaScript. Code examples provided here may contain errors or needs some additional coding. Make sure to test the code before using it on a live website!
Definition
Arguments
Fires after a new aggregate count is written, including when activity logging is disabled. Duplicate likes, failed item or lock acquisition, failed log inserts, and failed count writes do not emit it. Covers share, show, Explore, and Like. It does not confirm external sharing. The AJAX count cache has not yet been refreshed. Like listeners run before lock release. Keep listeners lightweight and avoid logging private input. Activity and count writes are not an atomic transaction.
Example
add_action( 'coresocial_tracking_recorded', function ( $input, $id, $logging ) {
// Invalidate your integration's cached aggregate for this item.
wp_cache_delete( 'item-' . $id, 'my-social-summary' );
}, 10, 3 );