Nick, take a look at
this file on Dropbox. It shows a solution that doesn't create dupes. You will need to capture the Cookie ID and save it in SFDC, then associate the anonymous activity via a webhook.
You could also do something similar via the SOAP API, but the webhook method is probably easier.