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:

    1) Is this for all versions of x-cart? I’m using 4.3.2
    2) How long after the code is implemented should it take for search terms to appear on Google Analytics?
    -I’m hoping it’s not immediately (which it was), because after the change, I haven’t seen my test queries come accross yet
    3)How do I clear out all these old search terms that were setup incorrectly? Or do I just do my analytics statistics from this date forward?

  2. SJM says:

    Hi Matt,

    1.) I’m not sure if this code is needed for 4.3 or not.
    2.) It will take up to 24 hours to show
    3.) Unfortunately you cannot clear old search terms, you’ll just have to ignore them. You can remove them out of any excel reports you export though

Leave a Reply