A few years ago, I tried a couple types of adhesive and none lasted. I replaced the top.
Now if I were to do it again, I'd use a tape type of product. The body of my 'Gambler 500' VW New Beetle is made of about 30% Gorilla tape. Good stuff.
If you can get good clean access to two opposing surfaces, use 3M double-sided tape. The 3M tape would probably work well if the window was fully removed, both surfaces cleaned and then taped back in. YMMV depending on what surface is being stuck to the glass.