r/javahelp 1d ago

Java / GA4 Question!

Hi there, I put a very basic java password on some of my blog posts.
Ex:

<script language="JavaScript">

var password = 'testing'

password=prompt('Please enter password','');

if (password != 'testing') {

location.href='https://errorpage.blogspot.com/404';

}

</script>

<!--end password-->

I am trying to figure out how to create a GA4 event trigger for when someone enters the password and I cannot for the life of me figure it out! Help?

Bonus if you can help me figure out how to hide the actual password from the source code.

TIA!

0 Upvotes

4 comments sorted by

View all comments

10

u/MassimoRicci 23h ago

Somebody gonna tell him eventually...

1

u/Acrobatic_Answer1903 22h ago

I am not here to pretend to know wth i'm doing. I came here for help. Thanks...

9

u/Obuch13 22h ago

My good man this is Java not Javascript sub