I use Great Stuff in my tanks and I know alot of members here have used it as well. In my experience the Great Stuff with the red lid will stick right to the glass whereas the Great Stuff with the black lid won't stick to the glass you have to put silicon on it first.

The only concern with Great Stuff is the time it takes to completely cure. and air out. It usually only takes a day or so to dry but then it can take a couple weeks to air out depending on the amount of air flow. Easiest thing to do to speed it up is to poke holes in the GS with a toothpick when it is dry to help air it out.