Magento Google Analytics E-Commerce Extension

Magento’s core Google Analytics module doesn’t track “Product categories or variations” so it’s difficult to identify the best performing categories or product options (such as size). We could modify the output of the _addTrans() and _addItem() methods to achieve this.

We can also identify the best performing marketing channels for customer acquisition. To do this, we need to create some custom session variables:

  • Original landing page without the query string
  • Original landing page with query string
  • Original referrer
  • Original keyword

So here is a simple Magento extension that will:

  • Track product item categories in Google Analytics
  • Track the first touch landing page, referal source and keywords

The extension is currently on github and is called ‘Custom_GoogleAnalytics‘.

TODO:
Shortly I will try to add the following features:

  • Configuration options so you can choose to track product variations (such as size and colour) instead of categories
  • Optional Google Tag integration
  • Add tracking to popup pages like “print invoice”
  • Move GA to before header tag

References: