How to create a template of recommendation
2
Edit the HTML

<div data-reco-id="{{reco_id}}">
<h2>{{ title }}</h2>
<div class="slider">
{% for product in products %}
<div class="product-card" data-item-id="{{product.id}}" data-reco-click="go_to_page">
<a href="{{ product.absolute_link }}" target="_blank">
<img src="{{ product.img_link }}" alt="{{ product.name }}">
<h3>{{ product.name }}</h3>
<span class="price">{{ product.price }} €</span>
</a>
</div>
{% endfor %}
</div>
</div>3
6
(If needed) Calling a templated recommendation via API
GET https://uc-info.eu.abtasty.com/v1/reco/{site_id}/template/{template_id}/recos/{strategy_id}Channel
Language
Example use case
Method 1 : cURL (Marketing Automation / Email tools)

curl 'https://uc-info.eu.abtasty.com/v1/reco/952/template/14aec6a3-5503-44a7-806b-45c1266b5b23/recos/390c046c-84e3-498d-a3ae-b050a6fdd8c9' \
-H 'authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaXRlX2lkIjo5NTIsImlhdCI6MTc0NDAxNDQ3NCwianRpIjoiTUtqa0VYbWhCYVdCN0NaMUZqUDlZekZoakE5YWpOcy05NUUxeDRPQ1J1dyJ9.PP_Qx28V777Zsu3q94qsDGhWZL3UoOhgTpg49cnqR1c'Method 2 — JavaScript Fetch (Frontend or Headless CMS)

const res = await fetch(
'https://uc-info.eu.abtasty.com/v1/reco/952/template/14aec6a3-5503-44a7-806b-45c1266b5b23/recos/390c046c-84e3-498d-a3ae-b050a6fdd8c9',
{
method: "GET",
headers: {
Authorization: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaXRlX2lkIjo5NTIsImlhdCI6MTc0NDAxNDQ3NCwianRpIjoiTUtqa0VYbWhCYVdCN0NaMUZqUDlZekZoakE5YWpOcy05NUUxeDRPQ1J1dyJ9.PP_Qx28V777Zsu3q94qsDGhWZL3UoOhgTpg49cnqR1c`
},
}
)
const data = await res.text(); // Returns HTML string
document.querySelector("#reco-banner").innerHTML = data;
const res = await fetch(
'https://uc-info.eu.abtasty.com/v1/reco/952/template/14aec6a3-5503-44a7-806b-45c1266b5b23/recos/390c046c-84e3-498d-a3ae-b050a6fdd8c9',
{
method: "GET",
headers: {
Authorization: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaXRlX2lkIjo5NTIsImlhdCI6MTc0NDAxNDQ3NCwianRpIjoiTUtqa0VYbWhCYVdCN0NaMUZqUDlZekZoakE5YWpOcy05NUUxeDRPQ1J1dyJ9.PP_Qx28V777Zsu3q94qsDGhWZL3UoOhgTpg49cnqR1c`
},
}
)
const data = await res.text(); // Returns HTML string
document.querySelector("#reco-banner").innerHTML = data;
Method 3 — Python (Data Pipelines / Internal Automations)

import requests
import json
res = requests.get(
'https://uc-info.eu.abtasty.com/v1/reco/952/template/14aec6a3-5503-44a7-806b-45c1266b5b23/recos/390c046c-84e3-498d-a3ae-b050a6fdd8c9',
headers={'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzaXRlX2lkIjo5NTIsImlhdCI6MTc0NDAxNDQ3NCwianRpIjoiTUtqa0VYbWhCYVdCN0NaMUZqUDlZekZoakE5YWpOcy05NUUxeDRPQ1J1dyJ9.PP_Qx28V777Zsu3q94qsDGhWZL3UoOhgTpg49cnqR1c'}
)
res.raise_for_status()
data = res.text
<div class="recommendation-banner">
<h2>Our top picks for you</h2>
<div class="products">
<div class="product-card">
<img src="https://example.com/img/product1.jpg" alt="Product 1">
<p>Product 1 – 49 €</p>
</div>
<div class="product-card">
<img src="https://example.com/img/product2.jpg" alt="Product 2">
<p>Product 2 – 59 €</p>
</div>
</div>
</div>PreviousMost common synchronization errorsNextHow to A/B test a recommendation strategy - For API clients
Last updated
Was this helpful?




