Executing front-end code when a user makes a purchase

I have a shopify store. And I would like to send some custom data about the purchase to the server (data that’s not on the purchase webhook).

How might I do that?

Order note attributes are what I most commonly use. Allows you to inject information from the storefront and pick it up in the database.