Checkout Marketing Options

I am looking to add a custom email and phone subscription option to the checkout (On Shopify Plus) but at present, I haven’t been able to connect it to the customer’s Marketing Status, so it changes when the customer completes the checkout process


	

		
		
	

	

The following code is being used. I would appreciate any guidance on resolving this issue