How to set an Infusionsoft affiliate cookie with JavaScript

I have a website with an IS form. when someone lands on that page, I would like to set a referral partner tracking code cookie, immediately.

I believe this can be done with some simple javascript.

My question is what details do I need to include in the JS? What is the format?

@mjfleming here’s the exact code to use:

document.cookie = "affiliate=AFFCODE HERE; expires=Tue, 31 Dec 2030 12:00:00 UTC; path=/";

@mjfleming WOW, you’re the best. Thank you :grinning: