Having read through FIFA's guidelines on offsides (<a class="postlink" href="http://www.fifa.com/mm/document/worldfootball/clubfootball/01/37/04/27/interpretation_law11_en.pdf" onclick="window.open(this.href);return false;">http://www.fifa.com/mm/document/worldfo ... w11_en.pdf</a>), it seems clear that the referee made the right decision for the goal.
A player in an offside position need only '[make] a gesture or movement which, in the opinion of the referee, deceives or distracts an opponent'. It's obvious that Gouffran's movement was some source of distraction to Hart given that he was in the direct path of the ball. In any case, the movement need only be deceptive 'in the opinion of the referee' and it's certainly not unreasonable in this case for the ref to think it was.
Well done to the referee for actually knowing the rules in this regard, it's a shame that those who didn't know the rules put him under such pressure that he went on to lose his cool and make some poor decisions. Perhaps those journalists, pundits, ex-players and ex-referees who believe the goal should have stood without question might wish to bone up on the rules rather than talking out of their a***s as usual.