The fitment object
The fitment object represents the compatibility of an aftermarket product with another product specified by a user when they are interacting with Sitecore Discover services. It is located in the context object.
It is important to send a fitment object only when the product matches the user's chosen fitment in analytic events such as add to cart
, order confirm
, widget click
, and so on.
The use cases are as follows:
-
If the search or recommendation API requests were made along with a fitment filter, then corresponding
click
events must include the user's fitment object. -
When a user is on a product details page, the fitment object must be included only when the product matches the user's fitment.
-
When a user adds a product to the cart, send the user's fitment that was associated with that product when adding to the cart.
-
When a user places an order, send the user's fitment that was associated with that product when it was added to the cart.
Not ensuring the user's fitment matches the product for which the event is being sent to Discover results in less accurate fitment-based analytics reports.
The following table lists the keys available in the fitment
object:
Name |
Type |
Description |
---|---|---|
|
Array of strings |
Array of user fitment IDs. Include this if you have a separate fitment entity with fitment IDs stored in your system. Send a fitment feed to Discover so we can identify your fitment IDs. Example: RequestResponse
|
|
Array of objects |
Array of fitment objects. Include this if you do not have a separate fitment entity. Note Fitment object keys differ by industry and can be customized. Speak to your Sitecore representative about your specific needs. Example: RequestResponse
|
Fitments might be specified in one or two different scopes. They might be specified as part of the context object, as part of the product object, or both. If they are included as part of the product
object, different fitments might be associated with each product. Examples of these events are product viewed
, product added to cart
, order confirm
, and widget click
.
For example, say a user buys a tire that fits a 1980 Toyota Camry (fitment ID: 1111). At the same time, they buy another tire that fits a 2010 Lexus ES300 (fitment ID 2222). In this example, you can specify the fitment for each product in the add to cart
and order confirm
events with individual fitments.
The following code block represents a fitment
object at the context level. There are two SKUs, but context
has only one fitment, which is the user's current fitment.
{
"type": "order",
"name": "confirm",
"value": {
"context": {
"fitment": {
"ids": [
"1111"
]
}
},
"products": [
{
"sku": "XYZ-111"
},
{
"sku": "XYZ-222"
}
]
}
}
The following code block represents a fitment
object at the product
level. Using this method is more accurate as each product clearly specifies its associated fitment.
{
"type": "order",
"name": "confirm",
"value": {
"context": {
},
"products": [
{
"sku": "XYZ-111",
"price": 514.99,
"quantity": 1,
"fitment" : {
"ids": ["1111"]
}
},
{
"sku": "XYZ-222",
"price": 549.99,
"quantity": 1,
"fitment" : {
"ids": ["2222"]
}
}
]
}
}