Using Discount Code in checkout by updating the cookie value directly

We are running onsite campaigns that provide customers a coupon code on the website. We want to be able to have the code automatically populate the discount code box at checkout but not require the customer to visit a specific URL like the basic Discount Rule shareable url feature. We can tell the discount code is written and pulled from a cookie. Simply writing our value to the cookie does not automatically load it in the checkout from our testing. We are using a valid discount code that is in the Shopify store account. Any idea of how we can utilize javascript and the offer cookie to make this function?

Not sure if you found a resolution to this. But it doesn’t look like the discount_code cookie is being used anymore by Shopify (written or read) to apply a coupon code to cart/checkout.