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’
Adjust your Site Search settings so they match below
All set! To view your new Site Search data navigate to Content->Site Search inside your profile
Tags: capture site query, Google Analytics Help, search terms, site search, x-cart, x-cart analytics


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?
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?