This section explains how we can calculate the search keyword from the referrer URL. Suppose a referrer URL is https://www.google.co.in/#q=learning+storm. We will pass this referrer URL to a class and the output of the class will be learning storm. By identifying the search keyword, we can easily identify the keywords users are searching to reach our site. Let's perform the following steps to calculate the keywords from the referrer URL:
- We are creating a KeywordGenerator class in the com.stormadvance.logprocessing package. This class contains logic to generate the search keyword from the referrer URL. The following is the source code of the KeywordGenerator class:
/** * This class takes referrer URL as input, analyze the URL and return search * keyword as output. * */ public class KeywordGenerator { public String getKeyword(String...