Getting User ID from simple on page form?

Hello everyone,

Trying to set up Matomo for use with virtual trade show booth tracking. I’m trying to establish a way to get the visitors name and email through a simple Bootstrap Modal that pops up when you visit. I see the User ID docs make this sound possible but I’ve also been trying to dust off my minimal coding skills so can’t figure out exactly how to make it work.

The form is part of the page but can anyone provide the code necessary to make that form push the name and email to the Matomo visitor record? Possibly have the email be the user ID and their name be a custom variable?

Thanks in advance!