This is what Opta say. Seems pretty arbitrary to me to be honest.It isn't on target unless the target was to not score a goal. I don't think that's the metric they use for shots on target.
https://www.statsperform.com/opta-e...the net regardless of intent – For Goals only.