Skip to content

규칙 기반 항목 권장 사항 만들기

카탈로그의 항목에서 규칙 기반 추천 엔진을 만드는 방법을 알아보세요.

규칙 기반 항목 추천 정보

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

추천 엔진 옵션

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

추천 엔진 만들기

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

카탈로그를 사용하여 추천 엔진을 만들려면 다음과 같이 하세요:

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

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

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

Braze의 카탈로그 예시.](/docs/ko/assets/img/recs/catalog_items.png?9086f1baf94f170dd46d08fe3744d435)

콘텐츠 카드 캠페인을 만듭니다. 작성기에서 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 }}

예를 들어

!콘텐츠 카드 캠페인의 메시지 작성기 예시.

클릭동작 섹션에서 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 }}

예를 들어

작성기의 클릭 시 동작 블록 예시입니다.](/docs/ko/assets/img/recs/on_click_behavior.png?7845113bcec98667c35c8de24bc2cb1b){: style=”max-width:60%;”}

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

!예제 커스텀 속성은 ‘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]}}

다음으로 사용자의 도시와 음식 유형에 따라 레스토랑 추천을 가져오고 싶다고 가정해 보겠습니다. 사용자의 도시 및 음식 유형에 대한 커스텀 속성을 통화 시작 부분에 동적으로 삽입한 다음 city_food.restaurants 변수에 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 %}

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

예제 최종 호출에서 생성된 레스토랑 목록의 렌더링입니다.](/docs/ko/assets/img/recs/sample_response.png?75bfcfca91ebe62c3ac240d4f0e253e1){: style=”max-width:30%;”}

New Stuff!