Best practices for tracking the success of different marketing channels

How do you track what is helping? A "how did you hear about us" question? Discount codes linked to specific channels? What has worked well for you?