before_body_end / google analytics isnt being rendered since upgrading to magento 1.9.1

913 Views Asked by At

I have a magento site which is built using the acumen/gravdept template. Google analytics used to work correctly, but since upgrading to 1.9.1 it has stopped working. The original version was 1.5.x

I am working in development mode, and I have disabled the options under cache storage management, turned off the profiler and flushed the magento cache and cache storage. I have even deleted the files under /var/cache.

I have tried copying googleanalytics.xml from the base/default/layout into my gravdept/acumen/layout folder and copying base/default/template/googleanalytics to gravdept/acumen/template/googleanalytics but that doesn't work for me.

I have also tried adding the following to gravdept/acumen/layout/page.xml

<layout version="0.1.0">
  <default translate="label" module="page">
    <label>All Pages</label>
    <block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
      ...
      <block type="core/text_list" name="before_body_end" as="before_body_end" translate="label">
        <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
      </block>
    </block>
  </default>
  ...
</layout>

I have <?php echo $this->getChildHtml('before_body_end') ?> in all of the page templates under gravdept/acumen/template/page/

Any help or advice would be great, I've spent hours on this and are going around in circles.

1

There are 1 best solutions below

4
On BEST ANSWER

You might enable that google analytics module in admin. Please check it if it was enabled : System->Configuration->Google Api->Google Analytics. That option should be enabled and set the account number.


The correct answer was mentioned in the comments below. I ended up creating frontend/gravdept/acumen/layout/googleanalytics.xml with the following content.

<layout version="0.1.0">
  <default>
    <reference name="after_body_start">
      <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
    </reference>
  </default>
</layout>