Open navigation

Creating Abandoned Search Templates

Because Klevu Search events send the product that the shopper clicked on, plus a list of all other products within that search result, it’s important that you have templates that can cater for 1 product (in the case that there is only one result), and a template that caters for multiple product results. 

Email Templates

Step 1: Creating a template for 1 product result

Download attached HTML template for 1 product

Download attached HTML template for 1 product

Clone any branded template.

Take out any content until it has a header with a logo, and any USP bar you usually have in your emails.

Then drag in a “Split”

Once you have the Split in, this first part is going to display the product the shopper clicked on.

Make sure the Split has an Image on the left side, and text on the right. It will look like this.

With the image selected, click “Browse Image Library”

Click on “Dynamic Image”

And paste the code for the Product Clicked imageURL.

{{ event|lookup:'Product Clicked'|lookup:'imageUrl'|default:'' }}

Click Save.

Then, for the Alt text, add in the Product Clicked Name

{{ event|lookup:'Product Clicked'|lookup:'name'|default:'' }}

And for Link Address, put in the Product Clicked URL

{{ event|lookup:'Product Clicked'|lookup:'url'|default:'' }}

It should look like this:

Now, for the text side of the Split.

This is where you can get creative with the available data. We suggest starting with something like this:

Hi {{ first_name|default:'there' }},

Are you still looking for this {{ event.Subjects.0|default:'' }}?

Take another look at {{ event|lookup:'Product Clicked'|lookup:'name'|default:'' }}.

Yours for {{ event|lookup:'Product Clicked'|lookup:'salePrice'|default:'' }}.

To create a hyperlink, select the Name code and for the URL, add the URL code for the same product:

{{ event|lookup:'Product Clicked'|lookup:'url'|default:'' }}

Then for the button. Some clients use this to link directly to the product, but you can also use this button to link back to their search.

Link to the product clicked, you can use the URL code you used in the text:

{{ event|lookup:'Product Clicked'|lookup:'url'|default:'' }}

To link to their search, go onto your website and put in your Website URL, do a search and take note of the URL of the search results. Replace the searched term with this code 

{{ event|lookup:'Search Term (full)'|lookup:'0'|default:'' }}

And paste the URL into the button URL section, e.g. 

https://URL.com/pages/search-results?q={{ event|lookup:'Search Term (full)'|lookup:'0'|default:'' }}

For the rest of the template, we suggest adhering to your usual brand guidelines, and ending the email with a brand image, key links for your brand, and footer information.

Click Save.

Once this is done, you can use Preview & Test button to see real data from Klevu Search Events in this template. 

Make sure you have chosen Preview Info “Event” and “Klevu Search” from the drop down.

Step 2: Creating a template for more than 1 product result:

Download HTML template for 5 products

Clone your template from above.

Change the RETURN TO YOUR SEARCH button to a SHOP NOW button, linking directly to the Product Clicked, but putting this code in the Button URL

{{ event|lookup:'Product Clicked'|lookup:'url'|default:'' }}

Now, add a text box below, saying something like “Not quite right? Here are some other options just for you.”

Below that add 2 Equal Columns:

Then drag a Split into the first column, making sure that the left side of the Split is an Image, and the right side of the Split is text.

It should look like this:

For the image side, we are going to follow similar instructions as above, but instead of the product Clicked data, we will use Search Result 0.

Id 

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'id'|default:'' }}

ImageURL

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'imageUrl'|default:'' }}

Name

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'name'|default:'' }}

Price

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'price'|default:'' }}

Sale price

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'salePrice'|default:'' }}

URL

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'url'|default:'' }}

With the image selected, click “Browse Image Library”

Click on “Dynamic Image”

And paste the code for the Search Results 0 URL

{{ event|lookup:'Product Clicked'|lookup:'imageUrl'|default:'' }}

Click Save.

Then, for the Alt text, add in the Name

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'name'|default:'' }}

And for Link Address, put in the URL

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'url'|default:'' }}

It should look like this:

Then for the text side. 

Paste this content to display the product name, and the sale price.

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'name'|default:'' }}

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'salePrice'|default:'' }}

To create a hyperlink, select the Name code and for the URL, add the URL code for the same product:

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'url'|default:'' }}

Now that the initial Split has been created, you can clone it to the other columns, and simply change the number in the code from 0 to 1, 2, 3, or 4.

Make sure you change it in all of these places:

Image:

Dynamic image - click “replace” and change the URL

Alt Text

Link address

Text:

Name

Name hyperlink

Price

When completed, your template should look like this:

SMS Templates

You can also create SMS templates that you can use in your Abandoned Search flows.

You can use the same codes from the Email tutorial, but since you havelimited space, we recommend focusing on the product the shopper clicked on, and potentially adding in a URL to return to their search results.

Email & SMS Klevu Search Event code library

As a reference, these are all of the available properties to use in Abandoned Search emails and SMS dynamically:

Product clicked

Id 

{{ event|lookup:'Product Clicked'|lookup:'id'|default:'' }}

imageURL 

{{ event|lookup:'Product Clicked'|lookup:'imageUrl'|default:'' }}

Name 

{{ event|lookup:'Product Clicked'|lookup:'name'|default:'' }}

Price

{{ event|lookup:'Product Clicked'|lookup:'price'|default:'' }}

Sale price

{{ event|lookup:'Product Clicked'|lookup:'salePrice'|default:'' }}

Url

{{ event|lookup:'Product Clicked'|lookup:'url'|default:'' }}

Search results

Id 

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'id'|default:'' }}

ImageURL

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'imageUrl'|default:'' }}

Name

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'name'|default:'' }}

Price

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'price'|default:'' }}

Sale price

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'salePrice'|default:'' }}

URL

{{ event|lookup:'Search Results'|lookup:'0'|lookup:'url'|default:'' }}

To add codes for other search results, simply replace the ‘0’ with another number.

Search term

Search term full

{{ event|lookup:'Search Term (full)'|lookup:'0'|default:'' }}

Subject

{{ event.Subjects.0|default:'' }}

Now that you have your templates created and saved, you can move on to creating Abandoned Search Flows.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.