You have to do at least one clean and full lap. And it's (only) your own racing line not an "official" one. I like that approach very much! You can also activate your own ghost or the one of other drivers (using the Leaderboard Challenge).