Pass nid variable to Ubercart order in D7
If you are using Cart Links (/admin/help/uc_cart_links), you could pass a value for a text-field type of attribute on your product. 
You'd have to add an attribute to the product node, and hide it via css or form_alter method on the product view page so that they couldn't overwrite it or delete it.
When they add attribute to the cart with the cart link, you can feed in the value with the url parameter like ( /cart/add/e-p23_q5_aThisNiceEscapedString. ).
Note that you can't just pass an integer to it, or Cart Links will think you are passing the AID (attribute ID)