Skip to content

규칙 기반 항목 추천 만들기

카탈로그의 항목에서 규칙 기반 추천 엔진을 만드는 방법을 배우십시오.

규칙 기반 항목 추천에 대한 정보

규칙 기반 추천 엔진은 사용자 데이터와 제품 정보를 사용하여 메시지 내에서 사용자에게 관련 항목을 제안합니다. 사용자 행동 및 속성을 기반으로 콘텐츠를 동적으로 개인화하기 위해 Liquid과 Braze catalogs 또는 Connected Content을 사용합니다.

추천 엔진 옵션

사용 가능한 리소스와 사용 사례에 적합한 추천 엔진을 결정할 때는 이 고려 사항 표를 참조하세요.

추천 엔진 만들기

카탈로그 또는 연결된 콘텐츠를 사용하여 추천 엔진을 만드세요:

카탈로그를 사용하여 추천 엔진을 만들려면:

  1. 제품 카탈로그를 생성합니다.
  2. 각 제품에 대해 추천 제품 목록을 “product_recommendations”라는 열에 구분 기호(예: 파이프 |)로 구분된 문자열로 추가합니다.
  3. 카탈로그에 권장 사항을 찾으려는 제품 ID를 전달합니다.
  4. 해당 카탈로그 항목의 product_recommendations 값을 가져와서 Liquid 분할 필터를 사용하여 구분 기호로 분할합니다.
  5. 이러한 ID 중 하나 이상을 카탈로그에 다시 전달하여 다른 제품 세부 정보를 수집합니다.

예시

건강식품 앱이 있고 사용자가 앱에 가입한 기간에 따라 다른 레시피를 전송하는 콘텐츠 카드 캠페인을 만들고 싶다고 가정해 보겠습니다. 먼저, 다음 정보를 포함하는 CSV 파일을 통해 카탈로그를 생성하고 업로드하세요:

카탈로그가 Braze에 업로드된 후 일부 카탈로그 항목의 미리 보기를 확인하여 가져온 정보가 정확하게 입력되었는지 확인합니다. 미리 보기에서 항목이 무작위로 표시될 수 있지만 추천 엔진의 출력에는 영향을 미치지 않습니다.

Braze의 예제 카탈로그입니다.

콘텐츠 카드 캠페인을 만듭니다. 작성기에서 Liquid 로직을 입력하여 캠페인을 수신할 사용자와 표시할 레시피 및 이미지를 결정합니다. 이 사용 사례에서 Braze는 사용자의 start_date(또는 가입 날짜)를 가져와 현재 날짜와 비교합니다. 날짜 차이에 따라 전송되는 콘텐츠 카드가 결정됩니다.

1
2
3
4
5
6
{% assign start_date = {{custom_attribute.${start_date}}} | date: "%s" %}
{% assign current_date = "now" | date: "%s" %}
{% assign diff = {{current_date}} | minus: {{start_date}} | divided_by: 86400 %}
{% assign days = {{diff}} | round %}
{% catalog_items Healthy_Recipe_Catalog_SMB {{days}} %}
{{ items[0].title }}
1
2
3
4
5
6
7
8
9
10
{% assign start_date = {{custom_attribute.${start_date}}} | date: "%s" %}
{% assign current_date = "now" | date: "%s" %}
{% assign diff = {{current_date}} | minus: {{start_date}} | divided_by: 86400 %}
{% assign days = {{diff}} | round %}
{% catalog_items Healthy_Recipe_Catalog_SMB {{days}} %}
{% if items[0].title != blank %}
{{ items[0].body }}
{% else %}
{% abort_message('no card for today') %}
{% endif %}
1
2
3
4
5
6
{% assign start_date = {{custom_attribute.${start_date}}} | date: "%s" %}
{% assign current_date = "now" | date: "%s" %}
{% assign diff = {{current_date}} | minus: {{start_date}} | divided_by: 86400 %}
{% assign days = {{diff}} | round %}
{% catalog_items Healthy_Recipe_Catalog_SMB {{days}} %}
{{ items[0].image_url }}

For example:

콘텐츠 카드 캠페인의 예제 메시지 작성기입니다.

클릭 시 동작 섹션에서 사용자가 iOS, Android 및 웹 기기에서 콘텐츠 카드를 클릭할 때 리디렉션해야 하는 위치에 대한 Liquid 로직을 입력합니다.

1
2
3
4
5
6
{% assign start_date = {{custom_attribute.${start_date}}} | date: "%s" %}
{% assign current_date = "now" | date: "%s" %}
{% assign diff = {{current_date}} | minus: {{start_date}} | divided_by: 86400 %}
{% assign days = {{diff}} | round %}
{% catalog_items Healthy_Recipe_Catalog_SMB {{days}} %}
{{ items[0].link }}

For example:

작성기에서 클릭 시 동작 블록의 예입니다.

테스트 탭으로 이동하여 사용자로 메시지 미리보기에서 커스텀 사용자를 선택합니다. 커스텀 속성 필드에 날짜를 입력하면 해당 날짜에 가입한 사용자에게 전송될 콘텐츠 카드를 미리 볼 수 있습니다.

‘start_date’라는 이름의 예제 커스텀 속성입니다.

연결된 콘텐츠를 사용하여 추천 엔진을 만들려면, 먼저 다음 방법 중 하나를 사용하여 새 엔드포인트를 생성하세요:

다음으로, 사용자 프로필과 커스텀 속성 값을 일치시키고 해당 추천을 가져오기 위해 엔드포인트를 호출하는 메시지에서 Liquid를 사용하세요.

1
2
3
4
5
6
7
8
{% connected_content YOUR_API_URL :save items %}

{% assign recommended_item_ids_from_user_profile = custom_attribute.${RECOMMENDED_ITEM_IDS} | split: ';' %}

{% for item_id in recommended_item_ids_from_user_profile %}
  {% assign recommended_item = items | where: "ITEM_ID", ITEM_ID | first %}
  recommended_item.item_name
{% endfor %}

다음을 교체하십시오:

예시

Zomato 레스토랑 데이터베이스에서 레스토랑 추천을 가져와 그 결과를 restaurants이라는 로컬 변수로 저장한다고 가정해 보겠습니다. 다음과 같은 연결된 콘텐츠 호출을 할 수 있습니다.

1
2
3
4
{% connected_content https://developers.zomato.com/api/v2.1/search?entity_id={{city_id}}&entity_type=city&count=20&cuisines={{food_type}}&sort=rating:headers{“user-key”:“USER_KEY”} :save restaurants %}

{{city_food.restaurants[0]}}

다음으로 사용자의 도시와 음식 유형에 따라 레스토랑 추천을 가져오고 싶다고 가정해 보겠습니다. 사용자의 도시 및 음식 유형에 대한 커스텀 속성을 통화 시작 부분에 동적으로 삽입한 다음 restaurants 값을 city_food.restaurants 변수에 할당하면 됩니다.

연결된 콘텐츠 호출은 다음과 같이 표시됩니다.

1
2
3
4
5
6
7
8
{% assign city_id = {{custom_attribute.${city_id} | default: ‘306’}} %}
{% assign food_type = {{custom_attribute.${food_type} | default: ‘471’}} %}

{%- connected_content https://developers.zomato.com/api/v2.1/search?entity_id={{city_id}}&entity_type=city&count=20&cuisines={{food_type}}&sort=rating:headers{“user-key”:“USER_KEY”} :save restaurants %}

{% assign restaurants = city_food.restaurants %}

{{city_food.restaurants[0]}}

레스토랑 이름과 평점만 검색하도록 응답을 맞춤 설정하려면 다음과 같이 통화 끝에 필터를 추가하면 됩니다.

1
2
3
4
5
6
7
8
{% assign city_id = {{custom_attribute.${city_id} | default: ‘306’}} %}
{% assign food_type = {{custom_attribute.${food_type} | default: ‘471’}} %}

{%- connected_content https://developers.zomato.com/api/v2.1/search?entity_id={{city_id}}&entity_type=city&count=20&cuisines={{food_type}}&sort=rating:headers{“user-key”:”USER_KEY”} :save restaurants %}
{% assign restaurants = city_food.restaurants %}

{{city_food.restaurants[0].restaurant.name}}
{{city_food.restaurants[0].restaurant.user_rating.rating_text}}

마지막으로 레스토랑 추천을 등급별로 그룹화한다고 가정해 보겠습니다. 다음을 수행:

  1. assign을 사용하여 “우수”, “매우 우수”, “좋음”의 등급 카테고리에 대한 빈 배열을 만듭니다.
  2. 목록에 있는 각 레스토랑의 등급을 조사하는 for 루프를 추가합니다.
    • 평점이 “우수”인 경우 excellent_restaurants 문자열에 레스토랑 이름을 추가한 다음 끝에 * 문자를 추가하여 각 레스토랑 이름을 구분합니다.
    • 평점이 “매우 좋음”인 경우 very_good_restaurants 문자열에 레스토랑 이름을 추가한 다음 끝에 * 문자를 추가합니다.
    • 평점이 “좋음”인 경우 good_restaurants 문자열에 레스토랑 이름을 추가한 다음 끝에 * 문자를 추가합니다.
  3. 반환되는 레스토랑 추천 수를 카테고리당 4개로 제한합니다.

최종 통화는 이렇게 이루어집니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{% assign city_id = {{custom_attribute.${city_id} | default: ‘306’}} %}
{% assign food_type = {{custom_attribute.${food_type} | default: ‘471’}} %}
{%- connected_content https://developers.zomato.com/api/v2.1/search?entity_id={{city_id}}&entity_type=city&count=20&cuisines={{food_type}}&sort=rating:headers{“user-key”:”USER_KEY”} :save restaurants %}
{% assign restaurants = city_food.restaurants %}
{% assign excellent_restaurants = “” %}
{% assign very_good_resturants = “” %}
{% assign good_restaurants = “” %}
{% for list in restaurants %}
{% if {{list.restaurant.user_rating.rating_text}} == `Excellent` %}
{% assign excellent_restaurants = excellent_restaurants | append: list.restaurant.name | append: `*` %}
{% elseif {{list.restaurant.user_rating.rating_text}} == `Very Good` %}
{% assign very_good_restaurants = very_good_restaurants | append: list.restaurant.name | append: `*` %}
{% elseif {{list.restaurant.user_rating.rating_text}} == `Good` %}
{% assign good_restaurants = good_restaurants | append: list.restaurant.name | append: `*` %}
{% endif %}
{% endfor %}
{% assign excellent_array = excellent_restaurants | split: `*` %}
{% assign very_good_array = very_good_restaurants | split: `*` %}
{% assign good_array = good_restaurants | split: `*` %}

Excellent places
{% for list in excellent_array %}

{{list}}
{% assign total_count = total_count | plus:1 %}
{% if total_count >= 4 %}
{% break %}
{% endif %}
{% endfor %}

Very good places
{% for list in very_good_array %}

{{list}}
{% assign total_count = total_count | plus:1 %}
{% if total_count >= 4 %}
{% break %}
{% endif %}
{% endfor %}

Good places
{% for list in good_array %}

{{list}}
{% assign total_count = total_count | plus:1 %}
{% if total_count >= 4 %}
{% break %}
{% endif %}
{% endfor %}

아래 스크린샷에서 사용자 기기에 응답이 표시되는 방식에 대한 예를 참조하세요.

예제 최종 호출로 생성된 레스토랑 목록의 렌더링입니다.

이 페이지가 얼마나 도움이 되었나요?
New Stuff!