Is there a way to combine the javascript for the google analytics link with the re-write javascript that switches the http/https in the address? (I only ask b/c I'm not a javascript person)
The google analytics script is:
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "Your_Account_Number";
urchinTracker();
</script>
And the re-write script (from above) is:
<script type="text/javascript">
if(location.protocol.toLowerCase() =='http:' &&
location.href.toLowerCase().indexOf('login') > -1 )
location.href = location.href.replace('http:','https:');
if(location.protocol.toLowerCase() =='https:' &&
location.href.toLowerCase().indexOf('login') == -1 )
location.href = location.href.replace('https:','http:');
</script >
Then is there a way to combine the two, so that the pages that DNN serves up as SSL (the ones with https prefix) look for the "https://www.google-analytics.com/urchin.js" and the non-SSL pages (the ones with http prefix) look for the "http://www.google-analytics.com/urchin.js"?
I really don't know javascript, and I'm pretty sure that the following won't work, but what about something along the lines of:
<script type="text/javascript">
if(location.protocol.toLowerCase() =='http:')
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript">
_uacct = "Your_Account_Number";
urchinTracker();
</script>
if(location.protocol.toLowerCase() =='https:')
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript">
_uacct = "Your_Account_Number";
urchinTracker();
</script>
</script >
Is something like this possible? If so, it would solve the problem of the mixed content message and so we could have google analytics and selective https pages in DNN.
Thanks for any javascript suggestions that may be needed to correct my feeble attempt at code!
Ari