Fix google anlaytics in magento custom template

If you have turned on your google analytics in admin console and you are using custom design template but the google analytics is not showing up in your html codes, look at the below steps to check if the codes are in your custom design are in placed.

1. check page.xml in app\design\frontend\default\[yourtemplate]\layout and verify if the following line is in place.


2. open *.phtml in app\design\frontend\default\magikjewellery\template\page and verify if the following line is after the tag



<!--?php echo $this--->getChildHtml('after_body_start') ?&gt;

3. clear your cache by going to admin -> system -> cache management and flush magento cache

4. open your home page, right click on it and select view source and check if the following codes are generated.

<script type="text/javascript">
    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        (document.getElementsByTagName('head')&#91;0&#93; || document.getElementsByTagName('body')&#91;0&#93;).appendChild(ga);

    var _gaq = _gaq || &#91;&#93;;

_gaq.push(&#91;'_setAccount', 'UA-1234567-7'&#93;);


Similar Posts:

VN:F [1.9.22_1171]
Rating: 5.5/10 (4 votes cast)
Fix google anlaytics in magento custom template, 5.5 out of 10 based on 4 ratings