It wasn’t due to his debate performance but in spite of it in my opinion. He did well because he was seen as a anti-washington anti-establishment conservative in a sea of rinos. Your assumption that he would have won the presidency is debateable. I don’t think he would’ve broken through the blue wall.
Cruz was using Cambridge Analytica, the same company later used by Team Trump. A method is a method.
Trump Knows You Better Than You Know Yourself
http://www.freerepublic.com/focus/f-backroom/3516872/posts