Gyles Seward Gyles Seward
Reading Time: 2 minutes

One of the questions we get quite a lot from people using the Magento platform is why their Google Analytics account isn’t showing the data from Magento transactions.

First, we usually ask people three quick questions:

1. Have you removed code from the root template files which is vital to the Google Analytics link?

2.Have you placed the tracking code into the head.phtml instead of using the Magento configuration?

3.Have you enabled e-commerce tracking in Google Analytics?

If they answer yes to any of these questions, then it’s an easy fix!

Make sure that you don’t remove any potentially vital code from the root template files.

While spring cleaning is great in the home, try not to do it too much in your root template folder. It may seem like a good idea to declutter and remove unused tags such as 1-column.phtml and 2columns-left.phtml, but you may inadvertently end up removing something that you need. If you have taken out these two snippets:

<?php echo $this->getChildHtml(‘after_body_start’) ?>

<?php echo $this->getChildHtml(‘before_body_end’) ?>

You could have stripped out some core functionality that you need for Google Analytics to work. Make sure that these two snippets are still in your root template folder.

Ensure that the Google Analytics tracking code is added via Magento configuration.

Instead of hard coding the tracking code into your head.phtml file, you should add it through the Magento configuration option in your backend. This is because this technique dynamically inserts the Google Analytics code into the page to ensure that transactional data such as sold items, prices and shipping is included in the analysis.

Make sure e-commerce tracking is enabled in Google Analytics.

If you aren’t seeing the data you need, it could be something as simple as ensuring that e-commerce tracking is enabled in Google Analytics. You can do this by clicking Admin-> View and going to View Settings, checking that e-commerce Tracking is set to on.

If you’re still having problems, it could be that you need a bit more technical help, so get in touch!