Content Recommendations via JSON Feed

The Content Recommendations via JSON Feed action allows you to deliver intelligent, personalized content suggestions in JSON format, so you can render them in your own layout using JavaScript. It’s ideal for custom-designed widgets, mobile apps, or SPA environments where you control the presentation layer.


How It Works

This action generates a dynamic JSON array of recommended items for each visitor, based on the algorithm and filters you choose. You can assign this JSON to a JavaScript variable on your page, and use it to render your own design, layout, or logic.

Popular use cases include:

  • Home page or blog suggestions
  • “You may also like” carousels
  • Recently viewed or goal-based content

Step 1: Choose Recommendation Type

Start by selecting what the recommendation is for (e.g. Home Page, Article Page, Category Page) and choose one of the available algorithm types, such as:

  • Most Popular
  • Recently Published
  • Recommended for You
  • Others Who Viewed This Also Viewed
  • Reached Goal

You can apply filters to include only content of a certain type, tag, or condition.


Step 2: Define Output Fields

Map the fields from your content feed to the keys that will appear in the JSON result. For each field, choose a source from your feed and assign a name for it in the JSON.

Example mapping:

ID number → internal_id
type → last_goal_user_0_first_name

These will appear in the output like:

[
  {
    "internal_id": "123",
    "last_goal_user_0_first_name": "Video"
  },
  ...
]

Step 3: Assign to JavaScript Variable

Specify the variable name that will hold the JSON result on your page. Example:

var myArticles = [...];

You can now use this variable in your JavaScript to loop through the articles and render them as needed.


Optional: Track Clicks and Views

To track clicks on recommended items, you’ll need to report the clicked item’s ID and the action ID using the following code:

(self.personyze=self.personyze||[]).push(['Article Viewed', ARTICLE_ID, 'action_id', ACTION_ID]);

You can also detect when the JSON becomes available using:

(self.personyze=self.personyze||[]).push(['When action executed', ACTION_ID, result_ready]);

function result_ready() {
  console.log('The JSON is ready');
}

Use Cases

  • Build a custom card layout or carousel based on the recommended data
  • Display suggestions in your app’s native format
  • Trigger animations, tooltips, or A/B logic based on recommendation content

Final Notes

  • The action runs client-side and does not render anything automatically.
  • You must handle the presentation using your site or app’s frontend code.
  • You can still apply targeting and scheduling like any other action.

Next Steps

Once you’ve set the algorithm, fields, and output variable, click Done Editing to save the action. The JSON will then be available for each visitor based on your configuration.