Enriching the product page with data from the catalog

Published August 30, 2022
Modules
Difficulty
Selected Clients
mediaexpert logorossmann logosharafdg logocarrefour logoeobuwie logo

In Synerise, we can use dynamic content campaigns in many different ways: to display a recommendation, pop-up, or use it as a tag manager that embeds various scripts on the website. One of the ways that we can also use dynamic content is enriching information about the product on the product page, for example, adding information about the low stock of the product, or displaying a label that the product is new / discounted or soon will be unavailable. We can use any information about the product that we collect in a product catalog to later display it on the product page in any way.

In this use case, we will show you how to enrich your product pages with information collected in the product catalog about quantity in stock and the “Super Offer” label.

Quantity in stock

Prerequisites


  • Implement Synerise tracking code on your website.
  • Implement OG Tags on your website.
  • Create a product catalog. In your product catalog add the following columns as custom attributes:
    • a column with information about quantity in stock for every product
    • a column in which you include information if a specific product has the “Super Offer” label - adjust the name to your business needs.
Example CSV file imported to the catalog
Example of a product catalog with necessary information about stock availability and "supper offer" label

Create a dynamic content campaign


In this part of the process, you will create the dynamic content campaign which will display stock data on your product pages and assign the “super offer” label to the specific products.

Create a dynamic content message


  1. Go to Image presents the Communication icon Communication > Dynamic Content > Create new.
  2. Enter the name of the campaign.
  3. Choose the Insert Object type.
  4. In the Audience section, select the Everyone tab.
  5. In the Content section, select Simple message, and in the CSS selector field, enter where you want to insert the content.
  6. Click Create message and choose Code editor.
  7. In the HTML section add the following code, which allows you to extract an item from the catalog and then obtain the values of particular columns for the product on the website.
 {% set additionalParamSku = metric_additional_params[ "product:retailer_part_no" ] %} 
 {% catalogitem.catalog-name(additionalParamSku) %} 
 {% set object = catalog_result %} 
 {{ object.get("superOffer") }} 
 {{ object.get("quantityInStock") }} 
 {% endcatalogitem %}
 

Where:

  • superOffer is the column name from your catalog in which you can find the information if the specific product has the “Super Offer” label.
  • quantityInStock is the column name from your catalog in which you can find the information how many products are in the stock currently.
  • metric_additional_params ["product:retailer_part_no"] is the ID of the product on the website, extracted from OG tags.
  • catalog-name is the name of the product catalog.
Note: Both column names are exemplary and based on the specific product catalog.

Check the example campaign code used in this particular use case below.

 {% set additionalParamSku = metric_additional_params[ "product:retailer_part_no" ] %}
 {% catalogitem.additional-info(additionalParamSku) %}
 {% set object = catalog_result %}
 <div class ="short-description">
 <h3>Quantity In Stock</h3>
 {{ object.get ("quantityInStock") }}
 </div>

 {% set ifOffer = object.get ("superOffer") %}
 {% if ifOffer == 'true' %}
 <div class="short-decription">
 <h3 style="color: red">Super Offer</h3>
  </div>
 {% endif %}
 {% endcatalogitem %}
 
Important: This is an example implementation and this code should be adapted to your business needs, taking into account the appropriate label layout and stock info. You should add the appropriate CSS styles and HTML code as well as JS code if needed.

Set up the schedule and display settings


  1. In the Schedule section, set the display time to Display immediately and save your changes.
  2. In the Display settings section, choose On landing and add additional delay if it is necessary.
  3. In the UTM & URL parameters section, click Skip step.
  4. Click Activate and start your dynamic content campaign.

Result: Quantity in stock section with the number of available products in stock is visible on every product page. If a specific product has the Super Offer label, the label is also visible on a product page.

Check the video

Watch the video with this use case to see how to prepare it step by step.

Check the use case set up on the Synerise Demo workspace


You can check the dynamic content campaign configuration directly in Synerise Demo workspace.

If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.

Read more


😕

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