---
title: "The context object"
slug: "the-context-object"
abstract: "Describes the usage and contents of the context object."
---
# The context object

In events, the `context` object is used to describe additional information about the user visiting the site, the page being visited, the location from which they are browsing, the device on which they are browsing, and so on.

`Context` objects are an integral part of all API requests for search, recommendation, and content widgets. The `event` object allows the same `context` object to be sent to any Discover API. This means that the context object data is standardized across all Sitecore Discover services.

Additionally, the `context` object is used when events are posted using a REST API call. In the absence of the Discover beacon, you must send information like `device` and `geo` in API calls using the `context` object.

The following table lists objects supported by the `context` object.

| Name | Type | Description |
| --- | --- | --- |
| `browser` | [browser object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-browser-object.html "The browser object") | Required when sending events using the Events API.<br><br>User's browser or device information. |
| `geo` | [geo object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-geo-object.html "The geo object") | Required when sending events using the Events API.<br><br>User's location information. |
| `fitment` | [fitment object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-fitment-object.html "The fitment object") | Required only when the user has selected a fitment.<br><br>User's fitment information in context of the product. |
| `user` | [user object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-user-object.html "The user object") | Required for user login and user info events.<br><br>User's information such as address, gender, ID, and so on. |
| `campaign` | [campaign object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-campaign-object.html "The campaign object") | Optional.<br><br>Information about the advertising campaign. |
| `page` | [page object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-page-object.html "The page object") | Required if locale is used.<br><br>Information about the current page, such as URL, referrer, and so on. |
| `store` | [store object](https://doc.sitecore.com/discover/en/developers/discover-developer-guide/integrate-using-discover-rest-apis/events-data-model/the-event-object-model/the-store-object.html "The store object") | Required when the event is an order event with BOPIS and the store has not been specified at the product level.<br><br>Information about store for BOPIS orders |

The following represents a generic event containing a `context` object:

```JSON
{
  "type": "...",
  "name": "...",
  "value": {   
    "products": [
      {       
        "sku": "191258"
      }
    ],   
    "index": "1",
    "text": "diamond rings",
    "type": "category",   
    "context": {     
      "fitment": {       
        "ids": [        
          "fit-id1",        
          "fit-id2"
        ]
      },
      "geo": {      
        "ip": "10.x.x.x",       
        "country": "US",       
        "state": "California",     
        "city": "San Mateo",       
        "zip": "94404"
      },     
      "page": {
        "locale_language": "en",       
        "locale_country": "us",     
        "locale_currency": "usd"
      },   
      "user": {     
        "id": "user-1234",       
        "email": "abc.def@email.com",
        "eid": "<hash_of_email>",      
        "fbid": "<facebook_id>",     
        "address": {         
          "address_line_1": "123 Main Street",        
          "address_line_2": "apartment 123",       
          "state": "CA",         
          "zip": "90210",      
          "country": "US"
        }
      },   
      "store": {    
        "id": "s123",   
        "group": "g1"
      }
    }
  }
}
```