Secure GetClicky Tracking Code on Magento Website

Written by Gordon

Topics: Magento

To use GetClicky analytics / tracking codes with Magento’s SSL (HTTPS) protected pages, you have two options. One is to use GetClicky’s HTTPS code throughout the website or use it within an IF clause. The following demonstrates an inbuilt Magento funtion to check if the visitor is on a HTTPS or HTTP page.

<?php // Check if HTTPS ?>

<?php if (Mage::app()->getStore()->isCurrentlySecure()): ?>

<?php // Clicky HTTPS tracking code goes here ?>

<?php else : ?>

<?php // Clicky HTTP tracking code goes here ?>

<?php endif; ?>

The above code might come handy for various cases where you might need to check for HTTPS.

Leave a Comment Here's Your Chance to Be Heard!