> For the complete documentation index, see [llms.txt](https://foodcommerce-api-help.onlinesales.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://foodcommerce-api-help.onlinesales.ai/user-tracking-events/js-sdk/track-impressions.md).

# Track Impressions

You can use the OnlineSales.ai pixel to track your ad impressions.

### Requirements <a href="#requirements" id="requirements"></a>

The pixel's [base code](/user-tracking-events/js-sdk/installing-the-tag.md#base-code) must already be installed on every page where you want to track conversions.

### Trigger <a href="#trigger" id="trigger"></a>

`AdImpression` event should be fired when a user visits a category page.

### JS API <a href="#js-api" id="js-api"></a>

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:

```javascript
// with minimum required parameters
_osAdImpression({
    "uclids": ["as123234198laskdnasd", "pq1we4198laskdnasd"]
})
```

List of all the standard events can be found [here](/user-tracking-events/js-sdk/references.md#standard-events).

### Object Properties <a href="#object-properties" id="object-properties"></a>

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

| Parameter | Description                                                                     | Mandatory |
| --------- | ------------------------------------------------------------------------------- | --------- |
| uclids    | Ad server ids. This id is returned as a part of the response of ad server call. | Yes       |
