Why would Olenna want to poison king Joffrey in Game of Thrones season 4 before the marriage was consummated?
Given that no other answer was given, here is my guess: to avert any suspicion.
Had Joffrey died soon after the marriage was consummated, Margaery would be very high on the list of the suspects, and not very likely to get her hands on Tommen.
Formally, the king rules, so getting Tommen is more important than becoming a queen quickly.
It is worth noting that I don't know what Westeros' laws say about widowed queen without male successors, but I'm judging by how quickly Joffrey was made king. I assume that a queen would keep her title, but Tommen would still become a king and get all the power, and Margaery would get the same status as Cersei (minus any government (read: Lannister's) support). This wouldn't do for her: she clearly stated that she doesn't want to be a queen; she wants to be the queen.
But, even if it wasn't the case and Margaery would get to become the new ruler, it is not very likely that she would survive long after becoming the prime suspect for the Joffrey's murder and - more importantly - after taking the power away from the Lannisters.
There is also a subplot of Petyr getting Sansa. That would've been much harder to achieve without her and Tyrion being accused of the murder. Now, this is not only Petyr's personal and business desire. Sansa was to be Lannisters' ticket to ruling the North, and taking that from them is also in Tyrells' interest, so it's by no means an irrelevant part of the conspiracy.
Olenna wants to kill the Joffrey as she don't want her granddaughter Margaery to married with cruel person. She talks to Sansa and come to know the he don't even have courtesy to respect his betrothed. Seeing his past actions, it becomes clear he is not even controlled by his mother Cersei. It is risky to getting one's family member with such person.
On other Tommen is easily controllable sweet boy. And Olenna didn't see risk for Margaery to become queen, as Tyrells have option to get Margaery get married with Tommen due to alliance . They still control supply for grains in this crisis situation and Lannisters/King's Landing depends on this alliance.
It is safe to assume that Olenna may become of Joffrey's cruelty towards whores and other people. Olenna don't want to take risk of leaving Margaery alone with Joffrey for long time. Also, if she has decided to kill him, better to do it before consummating, as it may give reason for Lannisters to deny marrying Tommen with Margaery.