Capture Site Search Terms in X-Cart w/ Google Analytics

June 16th, 2009

Tracking your internal site search engine is a great way to optimize your e-commerce store. The standard X-Cart reporting of site search does very little in helping you better analyze your visitor patterns.

You can uncover more actionable data by including Site Search in your Google Analytics reports. For more help on actionable data checkout the Top 5 Actionable Analytics Reports For X-Cart post.

To accurately track internal site search for X-cart (using X-Cart’s standard search engine) you must follow two steps.

NOTE: If you are using Altered Carts Smart Search module you can skip to step 2.

Installation

1. First we must modify the code.

Navigate to skin1/modules/Google_Analytics/ga_code.tpl and replace those contents with the following tpl:

X-Cart ga_code.tpl for Google Analytics Site Search

Be sure to replace UA-XXXXXX-X with your actual Analytics account number.

Save the new file and upload it over the old (after backing up).

 

2. Now login to your Google Analytics account

  • Click the ‘Edit’ link next to your profile and on the next page in the first box click the upper right corner that says ‘Edit’

Edit Instructions

Adjust your Site Search settings so they match below

Site Search Settings for X-CartAll set! To view your new Site Search data navigate to Content->Site Search inside your profile

Navigate to Site Search

Post to Twitter Tweet This Post

Tags: , , , , ,

2 Responses to “Capture Site Search Terms in X-Cart w/ Google Analytics”

  1. Matt says:

    This did not seem to work. I did exactly as stated above, then used the search function on the site and checked analytics…no searches.

    Is there any sort of waiting period before it works correctly?

  2. Ryan says:

    Hi Matt,

    What version of X-Cart are you using?

    I checked your store code and X-Cart is not calling the first portion of the .tpl

    Did you include the {if $main eq “search”} part?

Leave a Reply