This issue can occur for one of the following reasons
the function is called while the base code is being loaded
Resolution
You have to wait until our functions completely loaded on your website before calling mentioned functions.
One of the possible implementations could be
(function(){
var interval = setInterval(function() {
if("undefined" !== _osSaleComplete){
clearInterval(interval);
_osSaleComplete(_osProductObj); // function to be invoked
}
}, 500);
})();