The Google Analytics Cookies (yes, set via Js) are primary cookies, thus, only your domain is able to write those. So if it´s security your are looking for, that´s as secure as it gets.
Although, I´m not 100% sure about your question here, but if you are looking to enable Google Analytics only on HTTP pages, your can alter the GA code on your pages to do so in this way, as an example:
<script type="text/javascript">
if(document.location.protocol != 'https:'){
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
}
</script>