Need to run the custom script from the checkout page

Hi, I’m building a public app.
On the checkout page, I need to retrieve the customer’s email address (after they submit ). So I added a custom script to the theme.liquid file by embedding the snippets. The PDP, cart page are compatible with the unique script that was applied to the theme.liquid file. However on the checkout page, it does not function. I have to get the customer email address. Is there an other approach?