You could use JS API getLocation method to get the current host product page URL (Log in with Atlassian account) and then extract host base URL from it.
However, it will add some latency to UI.
AP.getLocation(function(location){
alert(location);
});
