Quick Start

Tamber's API allows you to easily stream events (user-item interactions) as they happen, and get highly accurate recommendations that are updated in real time. All requests can be sent as either GET or POST requests, and all responses, including errors, are returned in JSON.

Tracking events works just like it does for a data analytics service: whenever a user clicks, purchases, shares, thumbs, likes, hearts, favorites, saves... stream it to Tamber. Stored events are free, so just track everything – you can decide what to use in your engine later.

Overview

In this tutorial you will build your first Tamber recommendation engine using your own data. It should take 10-40 minutes of work, depending on whether or not you load historical data, and some extra time for seeding data and training. Feel free to use that time however you want.

There are 3 steps to setting up your engine: 1. Start tracking events 2. Create your engine 3. Put recommendations in your app

1. Stream events client-side

Tamber learns to make recommendations by observing what users do in your app. The track method lets you record any behaviors (like, purchase, click, etc.) that your users perform. Users and items that do not yet exist will automatically be created.

To start tracking events, add the snippet below anywhere that you handle user actions in your app. Just replace the project_key with your own project's public API key (found in your project's dashboard).

  • Node.js
  • Objective-C
  • Javascript
  • Android
var tamber = require('tamber')('project_key');

tamber.event.track({
    user: "583480",
    behavior: "vote",
    item: {
        id: "90674",
        properties: {
            type: "book",
            title: "The Moon is a Harsh Mistress",
            img: "https://img.domain.com/book/The_Moon_is_a_Harsh Mistress.jpg"
        },
        tags: ["sci-fi", "bestseller"]
    },
    context: {
        page: "homepage",
        section: "featured_section"
    }
}).then(result => console.log(result))
.catch(err => console.log("Request failed with error:", err));
package main

import (
    tamber "github.com/tamber/tamber-go"
    "github.com/tamber/tamber-go/event"
    "fmt"
)

func main() {
    tamber.DefaultProjectKey = "project_key"

e, info, err := event.Track(&tamber.EventParams{
    User:     "583480",
    Behavior: "vote",
    Item:     "90674",
    })
}
@import Tamber;

[Tamber setPublishableProjectKey:@"your_project_key"];
[Tamber setUser:@"user_rlox8k927z7p"];

TMBItem *item = [TMBItem itemWithId:@"90674"\
    properties:@{\
        @"type":@"book",\
        @"title":@"The Moon is a Harsh Mistress",\
        @"img_url":@"https://img.domain.com/book/The_Moon_is_a_Harsh Mistress.jpg",\
        @"stock":[NSNumber numberWithInteger:34]\
    }\
    tags:@[@"sci-fi", @"bestseller"]\
];

TMBEventParams *params = [TMBEventParams eventWithItem:item behavior:@"purchase" context:@{@