When loading Google Analytics, your script is failing due to the fact that you are importing GA always under http. If you load the profiler under HTTPS, the whole profiler will fail due to the inclusion of GA with http.
Simply load GA using a scheme-less URL
dom.createDom('script', {'src': '//www.google-analytics.com/ga.js', 'type': 'text/javascript'});