README.md in tamber-0.1.7 vs README.md in tamber-0.1.8

- old
+ new

@@ -62,11 +62,11 @@ The primary method of discovery in Tamber is the `Discover.next` method, which returns the optimal set of items that the user should be shown next. #### For You -To put personalized recommendations on your homepage, or in any recommended section, just call `Discover.next` with the number of recommendations you want to display (if you are calling server-side, also set the `user`). +To put personalized recommendations on your homepage, or in any recommended section, just call `Discover.next` with the given user's id and the number of recommendations you want to display. ```rb Tamber.project_key = 'your_project_key' begin @@ -78,64 +78,48 @@ rescue TamberError => error puts error.message end ``` -##### `continuation` +#### Up Next -`Discover.next` is optimized for the exact moment and context of the user at the time of request, so standard pagination is not possible. Instead, `Discover.next` uses automatic continuation to allow you to 'show more' or implement infinite scrolling. +Keep users engaged by creating a path of discovery as they navigate from item to item, always showing the right mix of items they should check out next. Just add the id of the item that the user is navigating to / looking at. -When you want to add more recommendations to those currently displayed to the user, just set the `continuation` field to `true`. Tamber will automatically generate the set of items that should be appended to the current user-session's list. The `Discover.next` user-session is reset when `Discover.next` is called without `continuation`. - ```rb -Tamber.project_key = 'your_project_key' - begin d = Tamber::Discover.next( user: 'user_rlox8k927z7p', - number: 10, - continuation: true + item: 'item_wmt4fn6o4zlk', + number: 14 ) d.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"} rescue TamberError => error puts error.message end ``` -#### Up Next -Keep users engaged by creating a path of discovery as they navigate from item to item. Just add the id of the item that the user is navigating to / looking at. +##### `continuation` +`Discover.next` is optimized for the exact moment and context of the user at the time of request, so standard pagination is not possible. Instead, `Discover.next` uses automatic continuation to allow you to 'show more' or implement infinite scrolling. + +When you want to add more recommendations to those currently displayed to the user, just set the `continuation` field to `true`. Tamber will automatically generate the set of items that should be appended to the current user-session's list. The `Discover.next` user-session is reset when `Discover.next` is called without `continuation`. + ```rb +Tamber.project_key = 'your_project_key' + begin d = Tamber::Discover.next( user: 'user_rlox8k927z7p', - item: 'item_wmt4fn6o4zlk', - number: 14 + number: 10, + continuation: true ) d.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"} rescue TamberError => error puts error.message end ``` -If you are tracking events in your backend and want to track `clicked` or `viewed` events when users request the next page, you can also get `next` for the user-item pair by adding the `get_recs` field to your `Event.track` call. - -```rb -begin - e = Tamber::Event.track( - user: 'user_rlox8k927z7p', - behavior: 'clicked' - item: 'item_wmt4fn6o4zlk', - get_recs: { - number: 14 - } - ) - e.recommended.each { |rec| puts "item: #{rec.item}, score: #{rec.score}"} -rescue TamberError => error - puts error.message -end -``` #### Trending Help your users keep their fingers on the pulse of your platform by showing them the hottest, most popular, newest, or most up-and-coming items.