Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rdhimanam/d40bd35740babc67e86fea8857399aee to your computer and use it in GitHub Desktop.
Save rdhimanam/d40bd35740babc67e86fea8857399aee to your computer and use it in GitHub Desktop.
Track correct code for Passster
function monsterinsights_passter_track_correct_code( $input ) {
// Check if Passster is active.
if ( ! function_exists( 'ps_fs' ) ) {
return;
}
if ( ! function_exists( 'monsterinsights_mp_track_event_call' ) ) {
return;
}
$args = array(
't' => 'event', // Required: Change the default type to event
'ec' => 'Passster', // Required: Event Category
'ea' => 'Correct Code', // Required: Event Action
'el' => $input, // Required: Event Label (User Input)
'ev' => '', // Required: Event Value, Rounded
'cid' => ! monsterinsights_get_uuid() ? monsterinsights_generate_uuid() : monsterinsights_get_uuid(), // Required: Google Client ID
);
monsterinsights_mp_track_event_call( $args );
}
add_action( 'passster_validation_success', 'monsterinsights_passter_track_correct_code' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment