I've been searching on how to set up a refer, and how it has been meant to use.

Is it for customers sothat they can refere a friend and have a kind of affiliate program, or is it to have e.g. google conversations?

Can this be done over the url with a referal code?
e.g. http://mydomain.com/index.php?ref=google_com

Thanks in advanced.. i've been looking for this but could not find a explanation of it..