This section explains how you can extract the searched 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 our
KeywordGenerator class and the output will be
learning storm. By extracting the keyword to be searched, we can easily identify the search keyword that users are using to reach our site. Let's perform the following steps to extract the keyword from the referrer URL:
KeywordGeneratorclass in the
com.learningstorm.stormlogprocessingpackage. This class contains the logic to generate the keyword from the referrer URL. The following is the source code of the
/** * This class takes the referrer ...