How to use Google Analytics as a Recommendation Engine?


It has been a long time.
Last post was in April.
I’m always showing up with a new trick or a tool after long breaks. The first one was the Google AdWords destination URL checker tool, for free, which is not avaliable for free in the market. The keyword suggestion tool, url decoder and many others you may find at this blog (Turkish).

This trick is a hidden one.
Cutroni was close to find it, ‘somehow’, back in 2007 (last paragraph)
There may be others are using it but no one has posted it before.
Anyway, it’s not a deal.

first impression from “Nick Mihailovski” (Senior Developer Programs Manager, Google Analytics, Google Analytics API, Developer Relations for Google Analytics) at Google Analytics Summit 2013, was “:)” “:biteslip” “:)” “ah, yea you can do that with analytics api” “sure, you probably did it” “:)” “well” “cool”

Well, no implementation required.
Just a new profile with different settings.

Let’s start!

As you may know Google Analytics has an Internal Search feature. Define the parameter name at settings page and it’s done.

Google support for setting up site search: Set up and configure Site Search

You will find the ‘Search Terms’ report under ‘Standard Reports > Behavior > Site Search > Search Terms’

send Mutemath – Reset to the background after these lines.

Like all the other Web Analytics analyzer engines, Google Analytics works the same way.

log sample;

25.11.2013 20:35 /home-page
25.11.2013 20:35 /search q=iphone

visitor landed at home page and searched for ‘iphone’. We have defined q as a site search parameter name and we have the site search report as iphone has been searched by 1 time.

if you click the keyword, you will have another report with 2 tabs. ‘Destination Page and ‘Refined Keyword‘.

‘Destination Page’ dimension values tell us which page your visitors are viewing after the search. ‘Refined Keyword’ dimension values tell us which keywords have been submitted afterwards.

so, the sample log file looks like;

25.11.2013 20:35 /home-page
25.11.2013 20:36 /search q=iphone
25.11.2013 20:37 /search q=iphone 5
25.11.2013 20:37 /search q=iphone 5s
25.11.2013 20:37 /search q=iphone 5s silver
25.11.2013 20:37 /product-detail/iphone-5s-silver

visitor refined the search until he finds what he is exactly looking for. Refines ‘iphone’ until ‘iphone 5s silver’. no any other page between searches.

search term: iphone
refined keywords: iphone 5, iphone 5s, iphone 5s silver

well, in this example ‘iphone 5s silver’ keyword also a refined keyword for ‘iphone 5s’

the questions is ‘What if you replace the search parameter with your categoryId or productId parameter?

and the answer is ‘Visitors who have viewed this category/product also visited this category/product’.

because the refined keyword report gives you exactly what have been searched after the actual search.

– You may get product recommendations
– You may get category recommendations
– You may fix your AdWords campaigns which are landing on an exact product/category (report will tell you that people who have been landed on that product/category refines with this one; eg. they are looking for an iPhone 16GB, not for a 64gb or you have missed the negative keywords, they are not looking for a Samsung S3 anymore, they are finding their ways to Samsung S4)
– You may find out which sub-category performs better than the actual one.
– and many more… I have thousands of examples, just imagine.

so, let’s try it!

results; (after couple of hours. I have filtered the report with Google AdWords campaigns for Car Accesories which lands to Car Accesories Category)

I have selected the 5th one, categoryId=26090, to take an action. Because %12 refinement means; %12 of people decided to move to another category, they need to refine! there should be a problem with landing if you compare with other categories on that report. %12 was the highest.

so, is a category for ‘Car Speakers’.

and lets look at the refined categories for category 26090;

They are not interested in with ‘Car Speakers’, they were actually looking for ‘Car CD/Mp3 Players’, thats why %12 of them switching to “CD/Mp3 Players”

Because of we have thousands of textAds, there may have been an issue with negative keywords or landing pages.
Well, there may be no problems at all. May be this fix will increase the conversion. I believe it is.

you can either automatize it with Google Analytics API.

..can push the recommended categories/products while a visitor is visiting the spesific product/category

Well, there are many programming languages out there and there is no need to share a spesific language code.
It is better to show you how I am using Google Analytics as a Recommendation Engine.
I have tried the same example above on Google APIs Explorer;

the answer was the same;

send the parameter, get the recommendation.
it works!

have a nice one!


  1. Great article. It shows that if you have a solid understanding of the analytics tools and if you have a well-structured web site with somehow rational visitors, you can get the tools work for you. I’ll argue that this trick creates a “decision support” system rather than a “recommendation engine”, but it doesn’t make it any less valuable.


    Bu arada şerefsizim benim aklıma da gelmişti 🙂 Tabii düşünmekle yapmak arasında çok fark var. Eline sağlık İbrahim.

  2. Great post Ibrahim.

    Definitely a comprehensive guide to understanding landing page experience from the user’s perspective. Many marketers should check out their site engine structure to fix bad “Destination Page”  problems using this way if their visitors always decide to move to another category!



Please enter your comment!
Adınızı Girin