You can set the cookies but that doesn't mean the browser won't remove them, or a ad-blocker prevent them from being set in the first place. I'm saying if you want something that always works, cookies likely aren't it.
You could do something like an iFrame, with the parent site passing information to the frame. Here's an example: https://medium.com/building-contently/tracking-people-across...