Relevance by Segment API
In your Search and Category API calls, add a new parameter, segment, to specify the segment name and value that you want to use for Relevance by Segment.
&segment=<segment_name>:<value>
Make sure you have integrated the Relevance by Segment Pixel. You can learn more about Relevance by Segment on this feature page.
Segment names may be one of the following from the table below, or any existing pixel parameter.
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 are using 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.
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.
Sample Requests
Given below are sample requests for Relevance by Segment parameters used in Product, Category and Content Search APIs.
The relevance by Segment parameter is currently supported on Pathways API but not on Recommendations API.
Sample API Request - Product Search
GET http://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"
Sample API Request - Category Search
GET http://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
Sample API Request - Content Search
GET http://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"