Can I create an action, like tagging, based on which referral tracking link someone came through?

I need to be able to create an action, like tagging, when someone optins in through a referral tracking link - so they opt into a webinar, for example but going to the optin page through a referral tracking link. Then I would like to tag them based on the referral tracking link they used. I can track optins and sales but not anything else (like if they attended the webinar). Any thoughts? Creative solutions?