Porsche announced Hartley as a factory driver of the Porsche 919 Hybrid in the FIA World Endurance Championship. Over the next four years, he won the 2015 and 2017 FIA World Endurance Championship. He also won the 2017 24 Hours of Le Mans and placed second in 2015 sharing the car with drivers including Timo Bernhard, former Formula One driver Mark Webber and fellow Kiwi Earl Bamber.