The Relevance by Segment feature requires a segment parameter that specifies the segment name and value.
Before you Begin
Make sure you have integrated the Relevance by Segment Pixel.
Which APIs support Relevance by Segment?
The following APIs support Relevance by Segment:
- Product Search API
- Category API
- Content Search API
- Pathways API
Syntax
&segment=<segment_name>:
Segment names may be one of the following from the table below, or any existing pixel parameter. If you use an existing pixel parameter as a segment, such as view_id, user_id, etc., then use it as the segment_name. For example, segment=view_id:AU.
Segment name | Description | Sample Values |
---|---|---|
customer_tier | Tier that the user belongs to. | Premium Gold Base |
customer_country | Country that the user belongs to or is accessing the site from. | US Australia |
customer_geo | Geography or region that the user belongs to. | Florida Asia |
customer_profile | Profile of the user. | Healthcare Cleaning |
If you do not want to pass any segment, then remove the segment parameter from the API call. The API will throw an error if an empty segment parameter is passed in your call.
Note on caching:
Bloomreach recommends you to turn off caching completely to ensure accurate results. If caching cannot be turned off all the way, we suggest caching results at a per query-segment level.
Example requests
GET https://core.dxpapi.com/api/v1/core/?
account_id=<Bloomreach provided account ID>
&auth_key=jazzhands
&domain_key=example_com
&request_id=8438674018839
&_br_uid_2=uid=7797686432023:v=11.5:ts=1428617911187:hc=55
&ref_url=http://www.example.com/home
&url=http://www.example.com/index.html?q=dresses
&request_type=search
&search_type=keyword
&q=dresses
&fl=pid,title,brand,price,sale_price,thumb_image,url,description
&rows=10
&start=0
&segment=customer_geo:NorthAmerica #Segment parameter with name "customer_geo" and value "NorthAmerica"
GET https://core.dxpapi.com/api/v1/core/?
account_id=<Bloomreach Provided Account ID>
&auth_key=jazzhands
&domain_key=example_com
&request_id=8830241055597
&_br_uid_2=uid=7797686432023:v=11.5:ts=1428617911187:hc=55
&ref_url=http://www.example.com/home
&url=http://www.example.com/index.html?q=cat000922
&request_type=search
&rows=20
&start=0
&fl=pid,title,brand,price,sale_price,colors,sizes,thumb_image,price_range,sale_price_range
&q=cat000922
&search_type=category
&segment=view_id:AU #Using an existing pixel parameter as the segment
GET https://core.dxpapi.com/api/v1/core/?
account_id=<Bloomreach Provided Account ID>
&auth_key=jazzhands
&domain_key=example_com
&request_id=8830241055597
&catalog_name=content_na_en
&_br_uid_2=uid=7797686432023:v=11.5:ts=1428617911187:hc=55
&ref_url=http://www.example.com/home
&url=http://www.example.com/index.html?q=cat000922
&request_type=search
&rows=20
&start=0
&fl=pid,title,brand,price,sale_price,colors,sizes,thumb_image,price_range,sale_price_range
&q=cat000922
&search_type=keyword
&segment=customer_geo:NorthAmerica #Segment parameter with name "customer_geo" and value "NorthAmerica"
API requests should be limited to 16K Bytes. API requests above this length will throw Error Code 414.
Code sample
Check the demo code sample that demonstrates how to implement Relevance by Segment.