If it's a valve game, it's better and cheaper to just purchase it via steam. In the end you'll have to put it into steam anyway, but if you purchase it via steam, there isn't that key-code issue that you're having.