Is the 'onbeforeunload' event 100% consistent, effective and worthy of using as a trigger for a shopping cart abandonment campaign?
Nothing is 100% reliable -- someone could just hit the power switch -- but it's good.
That being said, assume that it will fail sometimes. Use it more as a convenience for your customers than as a mission-critical piece of functionality.