Magento – Google Analytics not working in 1.7.0.2 (community edition)

ce-1.7.0.2google analytics

currently in that version of magento community, have done the "enable" button and entered account, no dice. Read on forum about a fix, not working. Im not getting ANY evidence to appear in my page source. I am not a proficcient in these languages, please be as elementary in ur response as possible, it wont hurt my feelings lol 🙂 Heres the code for the 2 relevant (i think) files:
googleanalytics.xml

<layout version=\"0.1.0\">

<!--
Default layout, loads most of the pages
-->

<default>
    <!-- Mage_GoogleAnalytics -->
    <reference name="before_body_end">
        <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
    </reference>
</default>

ga.phtml

<?php

?>
<?php if (!Mage::helper('core/cookie')->isUserNotAllowSaveCookie()): ?>
<?php $accountId = Mage::getStoreConfig(Mage_GoogleAnalytics_Helper_Data::XML_PATH_ACCOUNT) ?>
<!-- BEGIN GOOGLE ANALYTICS CODEs -->
<script type="text/javascript">
//<![CDATA[
    var _gaq = _gaq || [];
    <?php echo $this->_getPageTrackingCode($accountId) ?>
    <?php echo $this->_getOrdersTrackingCode() ?>

    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();

//]]>
</script>
<!-- END GOOGLE ANALYTICS CODE -->
<?php endif; ?>

Best Answer

Another potential way you could do it, is if you have the analytics code like you would put in any other website, head over to:

head.phtml of your theme file and drop the analytics code in there, or Go into your admin back end under design, and enter the code under 'miscellaneous code'.

Depending how you want to structure it their is multiple ways :)

Related Topic