pull affiliate id out of idevaffiliate for hidden form field
Our site uses idevaffiliate (great program btw) for affiliate tracking. I am trying to figure out how to pull the affiliate id from a cookie and have a form submit the value in a hidden form field. I know how to make hidden form fields, but pulling the id out of the cookie is giving me headaches.
The reason we want to do this is to submit the id in a form to our newsletter list program as a secondary tracking method for our affiliates. This way, when a user clears their cookies and completes a sale weeks or months later, we will be able see if an affiliate deserves a commission. We can download our newsletter list and see the affiliate id associated with our customers email. Some of our affiliate commissions are over $230 so we are trying to be as fair as possible to our affiliates (the more we pay them, the happier they are to promote us).
If the optin form is on the landing page, it's easy to get the id form the url with idevaffiliate, but some of our optins are deeper into our site. Because of this, we need to be able to pull the id out of the cookie. Any suggestions on how to do this greatly appreciated.
:)