_shopmsg('visitor.optinStatus', function gotStatus(isOptedIn) {
  // isOptedIn will be true if this visitor has opted in already
});

You may want to know if the visitor on your site has opted into ShopMessage messaging or not. You can use visitor.optinStatus to know if they are opted in and respond accordingly.

_shopmsg('visitor.optinStatus', function(isOptedIn) {
  if (isOptedIn) {
    // only show this promotion to visitors
    // who have opted in
    $('#myPromoDiv').show();
  }
});