Forum Moderators: DixonJones

Message Too Old, No Replies

RE : Google Analytics : https vs. http profiles

Response to Thread "Google Analytics : https vs. http profiles"

         

Trex005

11:50 am on Jul 22, 2006 (gmt 0)

10+ Year Member



There was a thread here that asked the exact same question that I was looking for, so when I figured out the answer, I came back here and registered so that I could post the answer for the next person that is looking. Unfortunately the thread was about 6 months old and apparently you are not allowed to reply to threads that are that old!
(mods, if you would move this message into that thread it would probably be much more helpful)

So here is the thread :

[webmasterworld.com...]

And here is my answer :

What I did was just use the ssl URL and use the same ID. I have only been doing this for a day now, but it does seem to be working well!
PHP Example :


if($_SERVER['HTTPS'])
{
$google_analytics_url = "https://ssl.google-analytics.com/urchin.js";
}
else
{
$google_analytics_url = "http://www.google-analytics.com/urchin.js";
}
echo "
<script src='$google_analytics_url' type='text/javascript'>
</script>
<script type='text/javascript'>
_uacct = 'ACCT_ID_GOES_HERE';
urchinTracker();
</script>
";

[edited by: Trex005 at 11:52 am (utc) on July 22, 2006]

Marc_P

3:31 pm on Jul 22, 2006 (gmt 0)

10+ Year Member



You don't need to do this. If your site has both http and https areas, you should simply use the https code across the board.

From the Google Analytics help section
"(...)Please note that you can add the secure tracking code to both non-secure and secure pages on your site."

Bewenched

8:12 pm on Jul 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Although this isn't directly on topic you do need to make darn sure that you site cannot be spidered under SSL. Search engines will view them as two separate sites and ding you for duplicate content.