Search Term Library For Codelgniter

Do you want to know how your user came to your website via search engine? User usually go to search engine like google and then type a search term and click link from search result page.  Search term can be used for analytic purpose, or search engine optimization (SEO) method.

First step to catch search term is getting the referrer. If referrer is a search engine, get the  search term, clean it from ‘bad words’ and return the result.  Simple, isn’t it? 🙂

WordPress community have a plugin to do the processes. And then i put some of its code to build library for CodeIgniter. You can download this library here.

Using this library is so simple.

$this->load->library(‘Terms_lib’);
$term = $this->terms_lib->search_term;

Done. 🙂

 

1 thought on “Search Term Library For Codelgniter

Leave a Reply to Bunda Bijak Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.