Can you create an action based on opting in through a referral tracking link - like tagging

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?

Thanks!