Skip to main content

Overview

Marketing Automation allows you to enrich messages with sequences of information about products and stores. Like other personalization syntaxes in Designer, product and store loops can be used in:

  • emails designs, built with Message Builder or imported into the HTML editor

  • email subject lines

  • sms designs

The loops used to display products in Orders and Abandoned carts for transactional campaigns are described in this specific guide.

Using loops to display specific products

To display a selection of specific products, list them by their product IDs.

Explanation:

For each product in the list of IDs (orange), Splio will include all the product fields (blue) found between the beginning and the end of the loop in the message to send.
The
{SPLIO ENDFOREACH} line ends the loop.

Using loops to display products from a Target filter

You can display all products (or a limited number) in a filter indicated by its numeric ID.

Explanation:

The line that begins the loop contains the SEGMENT keyword followed by the ID of the segment (orange). Splio will go over the loop once for each product in this segment.

The ID you are looking for is in the About of the filter and is called Designer ID (you can see where to find it in the second image)

Using loops to display products in a contact custom field

You can use a database field containing a list of products (e.g., favorites) to loop over. To do so, place the name of the field after the IN keyword.

Explanation:

For each product whose ID is found in the $favorites$ field, the product fields will be included in the produced message.
The loop ends once all product IDs in the field are exhausted.
To find the custom fields in your Splio universe, go to
DATA > Fields.

Using options on loops

Options allow you to limit the number of products shown by the loop and sort them.

  • LIMIT="n" sets the maximum number of repetitions to "n"

  • ORDERBY="field" tells Marketing Automation to sort the products by the field before doing the loop. It works only by selecting a numerical field, such as price.

  • DIRECTION="ASC|DESC" determines if the products are sorted in ASCending or DESCending order.

Explanation:

First, Splio creates a list of items from the product filter 316, ordered by price ORDERBY="price", from the highest to the lowest DIRECTION="DESC". Then it goes over the loop 4 times LIMIT="4", once for each element from the top of the list.
All the
product fields (blue) are included in the product HTML code. The condition, same as above, shows an image only if the $product.img_url$ is not empty.
The loop continues until all 4 products are displayed.

Using separators in loops

Splio can automatically include a predefined separator at regular intervals.

  • SEPARATOR="-----" defines the text (or HTML code, between the quotation marks) inserted as the separator

  • EVERY="n" is the number of loop repetitions after which the separator gets inserted.

Explanation:

The example produces table rows of 3 cells each. Each time the loop is run, it creates a cell with information on a single product and an image (all based on product fields, in blue). The separator is a small chunk of HTML, which closes the current table row and opens a new one.

Using store loops

With store loops, you can display data about stores in the same way as for products. To do so, you need to replace the PRODUCT keyword with STORE in the SPLIO FOREACH syntax.

As with products, you can:

  • display specific stores' data using their IDs

  • display stores from a Target store filter

  • display the favorite store with the ID in a contact custom field

Using loops to display visited products from Web Behavior

If you are tracking the behavior of your clients online with Web Behavior, you can access and display products linked to their activities using the VISITS keyword.

Explanation:

In this example, Splio queries the database for products associated with the client's visits online, using a timeframe for the tracked behavior using the following keywords:

  • AFTER="T-D-H" sets the starting point, only the user's behavior after this time will count

  • BEFORE="T-D-H" sets the endpoint for behavior.

The time takes the "T-D-H" form: the letter "T" is followed by the minus sign, then the number of days (e.g., "3D" for 3 days) and hours ("12H"). The timeframe is always calculated in relation.