You can set up an account-level Integration Action to run when a customer opts-in via the optional GDPR marketing consent checkbox. The Marketing Consent GDPR integration actions will run on any successful purchase where the Marketing Consent checkbox is added to the checkout and checked at the time of purchase.
This is typically used to give your customers the option to be added to your email list as newsletter subscribers.
Here is a preview of the optional GDPR checkboxes at the bottom of the checkout. The Terms & Conditions checkbox and the Privacy Policy checkbox are required. The Marketing Consent checkbox is optional.