Show If is an online tool that will help you generate PHP code to easily target your visitors based on their browser, operating system, referrer, screen resolution, language and location.
Most of the targeting options are found from the browser’s header information. You can use this online tool to generate code that can let you show ads to certain users, customize your landing page, ban certain users, geo-targeting, etc.
You can put a keyword instead of a domain name in the referrer section. The referrer section searches the entire referring URL string for the word you enter, not just the domain name. If you want to target people who searched for the keyword “Free” you could just put that keyword in the referrer section.