Home > EC-CUBE > EC-CUBE Google Analytics を SSL なページで使う

EC-CUBE Google Analytics を SSL なページで使う

EC-CUBEに Google Analytics のデータ取得スクリプトを埋め込むと、SSLがかかったページに移動するとブラウザー(Firefox)のロケーションバーに色がつかず、壊れた鍵マークがつく。

これを回避する策がこれだ

 <script type="text/javascript">
if (location.protocol == 'https:'){
document.write("<script src=¥"https:¥/¥/ssl.google-analytics.com¥/urchin.js¥" type=¥"text¥/javascript¥"><¥/script>");
}else{
document.write("<script src=¥"http:¥/¥/www.google-analytics.com¥/urchin.js¥" type=¥"text¥/javascript¥"><¥/script>");
}
</script>
<script type="text/javascript">
_uacct = "xx-xxxxxx-x";
_udn="none";
_ulink=1;
urchinTracker();
</script>

これを footer 部に入れてやればいい。

下記サイトで紹介されていた。

「Google Analytics を HTTPS(SSL)なページで使う」を少し改造する。

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://www.wiz.gr.jp/wordpress/37/trackback
Listed below are links to weblogs that reference
EC-CUBE Google Analytics を SSL なページで使う from WIZ-WORDPRESS│EC-CUBE-LABO

Home > EC-CUBE > EC-CUBE Google Analytics を SSL なページで使う

Return to page top