IME you can only earn miles on the UA codeshares (similar to Great Lakes) so none of the ex-BOS flights qualify (since they do not codeshare on those routes). It's only ex-SJU where they are co-marketed codeshares. In GUM Cape Air is a United Express carrier and does not market the flights themselves.
As an aside, ex-GUM Cape Air flies ATR-42s in United Express colors (they have 2). You won't find any references or seat maps for these AC anywhere on United's site (including the fleet information posted on the investor relations site).