Personyze Wiki Personyze Wiki docs
English
Open Personyze
Docs/ Audiences & Targeting/ Targeting and Recommending on the Last Search
Audiences & Targeting

Targeting and Recommending on the Last Search

Personyze keeps each visitor’s last search phrase on their profile — what it captures, how it differs from Keywords, how to target on it, and the algorithm that recommends from it.

5 min read Updated 2 hours ago

A search phrase is the most explicit thing a visitor ever tells you. Personyze keeps the last one on the visitor’s profile — the phrase, when it was searched, and where — so you can both target on it and recommend from it, long after the session it was typed in has ended.

What Personyze captures, and when

Three things are stored on the profile: the phrase, the time it was searched, and the source — whether it was typed on your site or arrived from a search engine.

They are written from two places, with no setup on your side beyond ordinary tracking:

  • Your own site search. When a page view carries your site’s search parameter — a results page such as /search?q=running+shoes — the phrase is stored with the source site. A search box wired up as a Personyze container reports the same three fields the moment somebody searches, without waiting for a results page.
  • A search engine. When the referrer carries a search phrase, it is stored with the source engine.

How it behaves over time

  • Each new search replaces the old one. It is the last search, not a history.
  • A page view with no phrase leaves it alone. Browsing after searching does not erase what they searched for — which is the whole point.
  • An empty phrase is stored as nothing at all, never as an empty string, so “has searched” and “has not” stay cleanly apart.
  • It survives the session. The phrase comes back with the visitor on their next visit, the same as any other profile field.
Last search is not the same as Keywords. The Keywords rule reads the search phrase of this session’s arrival. Last search is a profile field: the most recent phrase from anywhere, kept across sessions. Use Keywords for “how did this visit start”, and Last search for “what is this person looking for”.

Targeting on the last search

The rule is Last search, under the visitor’s profile rules in any campaign’s audience. It has three parts, and each one is optional:

  • The phrase, with the usual text operators. Contains is the safe choice — “contains shoes” matches running shoes and shoes for kids, where equals matches neither.
  • Searched — anywhere, on the site (search box or search page), or in a search engine.
  • Within the last — a recency window, where zero means any time.

Set none of them and the rule constrains nothing. Set only is not empty plus a window, and you have everyone who searched for anything in the last few days — which is exactly the audience a “picked for what you looked for” widget wants.

Worth knowing

  • “Is empty” means never searched. The other operators have nothing to say about a visitor who has never searched, so they simply do not match them.
  • When you exclude by last search, switch on Only match after a value is recorded on the rule — otherwise everyone who has never searched counts as a match, and on most sites that is the majority.

Recommending from the last search

In a Product or Content Recommendations campaign, the algorithm is listed as Matches their last search. Every other algorithm recommends from behaviour — what this visitor interacted with, what co-occurred with it, what is popular. None of those can answer a phrase. This one can.

How it picks

  • It matches the stored phrase against your catalog’s own words: for products, the title, brand and short description; for articles, the title, topic and description.
  • Matching is natural language, not a search-operator syntax. A visitor typing C++, an unbalanced quote or a stray asterisk cannot steer or break the query — a phrase that matches nothing simply returns nothing.
  • Relevance decides who is in the list; personalization only reorders it. Somebody who typed a phrase is owed items matching that phrase, not the items you would have shown anyway. Within the matching set, the same freshness nudge and per-visitor price band the other algorithms use apply.
  • It works the first time a phrase is typed. There is no nightly job and no phrase list to build up, which matters because search tails are long and the phrase that counts is usually a new one.

The widget only runs for visitors who have searched

Because the algorithm has nothing to say about a visitor with no stored phrase, the recommendations editor binds a page group for youSearched on this site — so the widget appears only for visitors who have searched. The editor says so on the widget. To override it, use the action’s own Restrict to picker, or choose All pages.

If you place such a widget by hand rather than through the editor, expect it to render nothing until the visitor has searched — that is the algorithm working correctly, not a broken widget.

Two recipes

“Picked for what you looked for”

  1. A Product Recommendations campaign with the Matches their last search algorithm.
  2. Audience: Last search is not empty, within the last 7 days.
  3. Place it on the home page or a landing page — the pages a returning visitor lands on, where nothing else knows what they were after.

Rescue a search that found nothing

  1. Target your search results page with Last search is not empty.
  2. Show a recommendation widget under the results, so an empty or thin result page still offers something relevant.
Did this page answer your question?
Thank you — that goes to whoever maintains this page.