I would like to pass the contents of a form field as a event label to Google Analytics.
However, I do not want to pass any personally identifiable information due to it being against Google's terms.
I am currently using this code to extract the appropriate form field's value, however, how would I tailor it so I only get the latter part of the email address.
@icloud.com | @btinternet.com | @xxxxxx.com etc??
Thank you very much in advance.
function() {
var field = {{Form Element}}.querySelector('#email_address');
return field ? field.value : undefined;
}