The 23-year-old MacLennan's score of 57.305 helped her edge past another Chinese favourite, Huang Shanshan, so when He stumbled MacLennan knew she had won gold.
"At that point I knew," a laughing and bubbly MacLennan told reporters after receiving her medal and expressed surprise that the renowned Chinese discipline had broken.
"That was a bit shocking too."
The gold is also Canada's first in the women's individual trampoline event, which became an Olympic sport at the 2000 Sydney Games after wowing spectators with the aerial acrobatics of athletes sailing through the air and executing graceful somersaults, backwards, forwards and with twists.
MacLennan said things started look good for her when she was awarded the best score of her career for a performance of high-flying precision in her sparkly bright red and white bodysuit, and only became better and more surprising after China's Huang scored below her at 56.730.
Then Beijing champion He stumbled after delivering a spectacular performance twisting and somersaulting up to 10 metres into the air .
Although MacLennan, who came seventh in Beijing, started fifth in the finals round, a less-than-stellar performance from Belarus' Tatsiana Piatrenia put her into medal contention.
Unlike gold medal winner MacLennan and silver medallist Huang, who were wearing their medals proudly, a tearful He clutched her bronze medal in her hands, obscuring it from view.
"After the mistake I didn't really think about getting a medal, but I was really hoping for one," He said. "I did my best in all the performances."
Huang said she was stunned by MacLennan's performance and tried to banish the pressure of outdoing it from her mind.
"I didn't even think about catching her, because in this kind of competition if you think too much about catching up with someone it will influence your performance," Huang told reporters.
MacLennan said she was looking forward to spending time with her family, who are all in London to see her and might allow herself a small treat.
"Maybe a little chocolate."
Britain's Kat Driscoll endured a heartbreaking exit from the preliminary round, with her final jump not enough to take the last qualifying spot from Russia's Victoria Voronina.
American Savannah Vinsant appeared to lose position during her routine but survived a marking down from the judges to score 54.955, sending her through above both the Brit and the Russian.
- Related links