I used Aquarium Sealant on my window. It obviously is meant to adhere to glass.
Be sure to clean the glass with ammonia or Windex.
Oh, better do the glueing outside as this stuff WILL knock you on your buttocks if you smell it long enough.
Go ahead......ask me how I know.