I know this thread is a big old...
But, I had a thought on your question about how Zynga does it, doesnt Zynga track the friend's ID on the invite, if so why couldnt they just check to see if that user had been referred or not from a variable in the database after they click invite?