Last active
August 20, 2021 18:52
-
-
Save rdhimanam/6d695ce399a01dff4f13b7c4a53ed3a4 to your computer and use it in GitHub Desktop.
Track Incorrect Code - Passter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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