i made a hook for saving the referer to the orders table and i copied the code from a other module and it worked
the only thing is, i'm not sure if every 3 functions are needed to only save the parameter to the DB or is one of them to use it from the DB. Thank you for clarifying:
is sufficient to insert it into the database. Both the other methods are about adding it to the order object, either during checkout or after. Note that there is also a bug in the constructOrder one. If orders_advertiser is set in the session during subsequent invocations (after checkout), it will change it on the order object to that value. It won't save it, so probably not a very impactful bug. But unnecessary if you are never accessing it through the order object.