In order not to ruin his carpet and floor, the owner did that, but someplace else - a precaution that gave him away.
precaution = something done in advance to prevent an unwanted/unpleasant result.
gave him away = showed him to be the culprit, the guilty person.
not a teacher
Student or Learner