Marketing Cloud PersonalizationのWeb Templateで、ビジネスユーザーが選択できるRecipeのCatalog種別を制限する方法を解説します。Serverside CodeでrestrictItemTypeを指定することで意図しないアイテムタイプの選択を防ぎます。
Marketing Cloud PersonalizationのWeb Templateでは、サーバーサイドコード(TypeScript)で RecommendationsConfig クラスの restrictItemType メソッドを使用することで、キャンペーンで選択できる Recipe の Catalog 種別を制限できます。
この設定を行うことで、ビジネスユーザーがキャンペーンを設定する際、指定したアイテムタイプ(カテゴリやプロダクトなど)の Recipe のみを選択できるようになります。これにより、テンプレートの目的に合致しない Recipe が誤って選択されることを防ぎます。
サーバーサイドコード内で recsConfig プロパティを定義し、制限したいアイテムタイプを引数として指定します。
Webテンプレートのエディタを開く
サーバーサイドコードに以下の記述を追加する
recsConfig: RecommendationsConfig = new RecommendationsConfig()
.restrictItemType("Category")
上記の例では、選択可能な Recipe が Category に限定される
ビジネス要件に応じて "Product" や "Article" などのアイテムタイプを指定することも可能である
restrictItemType を明示的に指定しない場合、デフォルトで Product が選択された状態となります。プロダクト以外のレコメンド(カテゴリや記事など)を表示するテンプレートを作成する場合は、必ずこのメソッドを使用して意図したアイテムタイプを明示的に指定してください。
アイテムタイプの制限に加えて、推奨アイテムの最大表示数を制限することも可能です。その場合は restrictMaxResults メソッドを使用します。
実装の詳しい仕様や追加のコード例については、Salesforce DevelopersのRecommendationsガイドを参照してください。
キャンペーンの作成時やWebテンプレートの設定時に、Page Type や Content Zone がプルダウンから選択できない事象が発生することがあります。サイトマップの設定やサイトの連携状況が原因となっている可能性があるため、詳細なトラブルシューティングについては、以下のナレッジ記事を参照してください。
Marketing Cloud Personalization | Web キャンペーンや Web テンプレートでページタイプまたはコンテンツゾーンが選択できない
005389048

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.