googletag.cmd.push(function() { googletag.display('div-id'); });
you can check wether the targeted ID in the googletag defined slots exists in the DOM before displaying it :
//get all the defined slots
var definedSlots = googletag.pubads().getSlots();
//loop through the definedSlots
for (var x = 0; x < definedSlots.length; x++) {
//retrieve the targeted ID
var slotId = definedSlots[x].getSlotId().getDomId();
//if it exists
if (document.querySelector('#'+ slotId)) {
//then dislay it
googletag.cmd.push(function() { googletag.display(slotId); });
}
}