Ostensibly is an adverb you use to talk about something that looks one way, but underneath there's the hint of a different motivation for that action.
One day you go to an ice cream shop. Then the next day. And the next. You keep going, ostensibly to buy ice cream, but there’s a deeper reason. The cute person who works there, perhaps? To ostensibly do something admits that the surface reason might not be the only reason. The Latin root words translate as “to stretch in view of,” so imagine that you’re stretching a thin mask over your true intentions.