Tracking OpenCart Searches Through Google Analytics

This is part three of the blog series concentrating on integrating OpenCart and Google Analytics even tighter to get more data from your online store. See the complete list of the series here

OK, so one of the best things about OpenCart is that it offers a search function which allows your customers to find the products they’re after. Once you have this information it can be used to determine which of your stock are most popular with potential customers and possibly bring it to the front page of the site or include it more often in your Marketing materials.

However, OpenCart by default doesn’t easily give us that information. In this quick blog post we will be looking at how we can set up Google Analytics track all of the searches made by a customer and store it handily with the rest of your eCommerce data for mining and examining.

Setting up your Google Analytics Account to track OpenCart searches

This is a simple process, but it’s turned off by default in your Google Analytics account so you will have to activate this property before you can use it to track all of your customer searches in OpenCart.

Firstly, login to your Analytics account and choose the account which you want to track. Then click “Admin” in the top right hand side of the screen.

From here you will see a list of profiles associated with this account, choose the one you want to track searches for and then click on the “Profile Settings” link. This will take you to a page with of options, right at the bottom will be an option to allow Analytics to track Site Search.

Click the radio button for “Do Track Site Search” and this will pop up with a text box where it will ask for the parameter to find the search term. On OpenCart there are multiple extensions and vqMods which change this normal filter but in most cases it will be “filter_name” (without the quotation marks). If you want to check simply go to your OpenCart store and search for “test search”. On the search results page it’s unlikely that it will show any products but have a look at the URL and look for the term test search in it.

It will look something like …index.php?route=product/search&[SEARCH_PARAMETER_NAME]=test%20search. The text which lies between the & and the = symbols will be the term which you need to put into the text box. So, for example:


will mean that the search term is “q”. So, I would put q into the search parameter box on the Google Analytics page.

There will be two other checkboxes underneath the text box to allow stripping the other parameters out of the URL and allowing category search, in the interest of keeping it simple I normally just leave these unchecked and click “Apply”.

There we have it! The searches can be viewed and filtered from the Site Search from the normal Reporting section of Analytics under Content -> Site Search.

Nice and easy one today! Any questions or comments, just leave a comment below!

Leave a Reply