Avoid script inlining at custom error pages

I try to track how often I got 500 errors on my site in Google Analytics. I created custom error page, and inserted Google Analytics code in it.
When I make a check in preview mode I see that GA script is fetched from google and inlined into my error page. Is there any way to avoid such a behavior and leave GA Analytics operational?
Here is preview url: Preview Custom Errors