Track Restaurant View

You can use the OnlineSales.ai pixel to track your website visitors' product view action. Tracked product views are used to compute the popularity score, user's affinity, and other signals.

Requirements

The pixel's base code must already be installed on every page where you want to track product views.

Trigger

Restaurant View event should be fired when a user visits a product page.

JS API

All events are tracked by calling one of the library's function with a JSON object as it's parameters.

Following is a function call to track when a visitor has viewed a product on the website:

// with minimum required parameters
_osViewRestaurant({
    "cli_ubid": "ubid-83789ssb",
    "restaurants": [{
        "restaurant_id": "SID-9999"
    }]
})

A list of all the standard events can be found here.

Object Properties of Products key

You can include the following predefined object properties with any events that support them. Format your parameter object data using JSON.

A complete list of object properties can be found here.

An example call of a function with all the product properties:

// with all parameters
_osViewRestaurant({
    "restaurants": [{
        "restaurant_id": "SID-9999"
    }],
    "cli_ubid": "ubid-83789ssb"
})

Last updated