This might be useful for someone else. I wanted to be able to track form submissions on Ajax-enabled Gravity forms with an analytics event, and I also didn't want to create separate confirmation pages for each form, or edit the confirmation message individually.
Pastie for sticking in the active theme's functions.php:
The (ajax) confirmation message is in a frame which doesn't have access to jquery or the google analytics library, so the - perhaps a bit inelegant - solution is to call the scripts again from within that frame. Might also work just by pasting these into the confirmation message.