Dynamic content inserts

WARNING: If an insert in a Dynamic Content communication is malformed, the communication fails and is not downloaded by the SDK at all.

Common tags available in dynamic content

You can use all tags from Insert usage.

Accessing meta properties

To access the value of a product: meta tag’s content attribute when creating dynamic content, use the following syntax:

{{ metric_additional_params["product:PARAM_NAME"] }}

Important:
  • This method only works with HTML meta tags that have the property and content attributes.
  • This only works with product: tags, for example product:retailer_part_no. It does not work with tags such as og:url and with the product:category tag, which is reserved..

This allows you to modify and personalize the page depending on metadata. For example, you can manipulate search results or manipulate which catalogs are accessed.

Example

// Get the unique ID from meta tags:
{% set key = metric_additional_params['product:retailer_part_no'] %}
// Use the part number to retrieve the value of the 'title' column:
{% catalog.catalogName(key).title %}

You can use this mechanism to retrieve data such as the name, price, or brand of an item from a catalog. Thanks to this, the catalog can become a single source of data for multiple websites that present the same item.

In this example, the insert is used in a dynamic content communication created for the article you are reading now.

Configuration of the example
Content configuration of the example

The communication:

  1. Checks the unique ID of the item (this article) in the page’s OG tags.
  2. Retrieves the title of the item from the HelpCenterAi catalog in Synerise.
  3. Replaces the content of the code tag below with the retrieved title.

The content of the following code tag is replaced:
Replace this text

The original HTML code, before dynamic content is downloaded, is the following:

<code id="fill-in-with-dynamic-content">Replace this text</code>

Social proof

To create social proof, you need to create a metric with a dynamic key. To find out how to do it, read this article.

Syntax:

{% socialproof %} metric-hash {% endsocialproof %}

Example:
The number of times the product was added to cart during the last 30 days.

<div class="snrs-wrapper">
  <div id="snrsCornerMessage" class="snrs-corner-message-wrap">
    <div class="snrs-corner-message">
      <div class="snrs-corner-main">
        <div class="snrs-corner-message-text">
            This product has been added to the cart {% socialproof %} 537165da-9d8c-4460-a3a2-6294f1f7aef9 {% endsocialproof %} times in the last 30 days!
        </div>
      </div>
    </div>
  </div>
</div>

Output (metric result is “235”):

<div class="snrs-wrapper">
  <div id="snrsCornerMessage" class="snrs-corner-message-wrap">
    <div class="snrs-corner-message">
      <div class="snrs-corner-main">
        <div class="snrs-corner-message-text">
            This product has been added to the cart 235 times in the last 30 days!
        </div>
      </div>
    </div>
  </div>
</div>

Validation

Whenever you use Jinjava in dynamic content, verify that it displays correctly for a few different test customers to make sure that the logic you applied covers all scenarios. If Jinjava fails to render, the communication is not sent to a customer at all.

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker