Login

Tag "search-engine"

Snippet List

Search Engine Referrer info in request

This is exacly the same snippet as #197 http://www.djangosnippets.org/snippets/197/ but returning search enigne, search engine domain and search term in: request.search_referrer_engine request.search_referrer_domain request.search_referrer_term I wanted to show ads only to people comming from search engines so I took snippet #197 and modify it to put that info in the request object.

  • middleware
  • referer
  • http_referer
  • request
  • search-engine
  • referrer
Read More

Middleware to detect visitors who arrived from a search engine

Sometimes it's nice to know if your visitors came from a search engine such as Google or Yahoo. I use this as a component in determining the popularity of blog articles for search keywords, so I know which articles to automatically feature or suggest. Maybe you'd like to use it to highlight the visitor's search terms on the page. This isn't actually middleware in the sense that it defines any of the middleware interfaces. It's intended to be the base for a middleware method that you write, depending on what you want to happen when you detect that the visitor came from a search engine. In the example `process_view` method, I detect when the request is going to use the `object_detail` view and log the search query for that object in the database.

  • middleware
  • search-engine
  • referrer
Read More

2 snippets posted so far.