Enhancing Analytics - more intelligence with search and notices

This article explains how to improve analytics insight and creates proven, actionable steps to improve conversions. It offers 2 key insights into visitor behaviour and enhances data in Google Analytics for:

  • Search Terms - we can log and report on the benefit of search terms being redirected to better landing pages using the inbuilt Magento feature
  • Notices, Errors, Success Messages - we can now log these easily as events into Google Analytics for in-depth analysis

Search Terms

Using our extension (attached), we can tag a query sting automatically to the end of a redirect URL in Magento. Here is an example


The above URL will actually redirect to the Trimmers & Brushcutters page, however with our extension, an additional query parameter is passed to the page so that with GTM we can pick this up and set a new Dimension in order to compare redirected searches with standard searches.

Steps to configure;

  1. Install the attached extension
  2. Create a new Custom Dimension in GA and call it 'Search - Better Landing Pages', make a note of the dimension ID
  3. In GTM;
    1. Create a new Variable called 'datalayer_blp' defined as Custom Javascript pasting the code from the attached datalayer_blp.txt
    2. Edit your existing Universal Analytics Tag and add a Custom Dimension with the Index matching the dimension ID from your newly created GA Dimension from step 2 above and paste the Dimension Value as {{datalayer_blp}}

Once you have tested the above in Preview mode in GTM you can go ahead and Publish the container. This will now log search redirect data into Google Analytics as a Custom Dimension.

Magento Notices

In Magento there are standard messages which are displayed throughout the website which can offer fantastic insight.

In order to configure this correctly there must be an existing configuration in GTM for Universal Analytics along with a variable for {{AnalyticsPropertyID}}

Steps to configure;

  1. In GTM visit Admin, then select your container, then click Import Container
  2. Download the attached GTM-EnhancedAnalytics.json file and select this with the 'Choose Container' button
  3. Select Merge mode (and Overwrite Conflicting Tags....) and ensure when you click Continue that there are 2 Tags, 2 Triggers and 2 Variables.

With the above 2 elements in place you should now be able to gain some great insights into;

  1. Redirecting onsite searches to better landing pages - Visit Behaviour > Site Search > Overview. Viewing this screen will tell you the average conversion rates etc. You can then filter to a secondary dimension and select your Custom Dimension and this will give you just the data for the searches which were redirected. 
  2. Magento Core Messages - Visit Behaviour > Events in Google Analytics and gain valuable insight into events such as:
    1. Failed Logins
    2. Out of stock notices
    3. Invalid Coupon Codes



Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk