Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rdhimanam/6d695ce399a01dff4f13b7c4a53ed3a4 to your computer and use it in GitHub Desktop.
Save rdhimanam/6d695ce399a01dff4f13b7c4a53ed3a4 to your computer and use it in GitHub Desktop.
Track Incorrect Code - Passter
jQuery( 'document' ).ready( function( $ ){
$('.passster-submit').on('click', function(e){
ps_id = $(this).attr('data-psid');
input = $( "#" + ps_id + ' .passster-password').val();
var form = $(this).parent().parent();
let error = form.find( '.passster-error' ).text();
// Error message should exactly be as it is set in the Customizer
// By Default the error message is "Invalid Password."
if ( '' !== error && 'Invalid Password.' === error ) {
__gtagTracker( 'event', 'Incorrect Code', {
event_category: 'Passster',
event_label: input,
});
}
})
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment