Segments Tutorial
Last updated
Was this helpful?
Last updated
Was this helpful?
Customer Segment Service allows you to group your customers in many convenient ways that suit different purposes. You can assign products or categories to create targeted marketing campaigns and display the relevant items on the storefront. The flexible service's API facilitates configuring and managing customer segments.
To create and configure a segment, you need the customersegment.segment_manage
scope.
Create a customer segment by sending a request to the the endpoint.
Connect the segment with specific products and/or categories for more customized content.
Note that this operation performs an UPSERT
operation. The UPSERT
means that if an item is already assigned to a segment, the assignment gets updated. If not, the new one is created in the system.
Now, add customers to the segment. Depending on your setup and purpose, you can add B2B or B2C customers.
Note that this operation performs an UPSERT
operation. The UPSERT
means that if a customer is already assigned to a segment, the assignment gets updated. If not, the customer assignment is created in the system.
To search for a segment, you need the customersegment.segment_read
scope to retrieve all customer segments.
In the request body, pass the criteria you're looking for in the q
parameter.
Set the segmentRestricted
parameter as true
and specify the segments you want to apply the coupon to.
Having segments in place, you can use that functionality on your storefront. Depending on your business goals, you can utilize the segments differently. Decide whether you'd like to extend the assortment with the products/categories assigned to a given segment to, for example, promote certain items on your site. Or, you'd rather limit products/categories visibility to only those that a segment defines for segment members, to be able to sell specified products through a channel that targets the right group of people.
Depending on your needs, you can limit the search using the q
parameter, for example, q=type:PRODUCT
or q=type:CATEGORY
.
The request generates a category tree with categories assigned to a segment and their parent categories, if applicable. If a segment specifies a subcategory only, the customer of that segment is able to see the parent category label, but content-wise, only the products from the subcategory are available.
```bash curl -i -X GET \ 'https://api.emporix.io/category/{tenant}/categories/{categoryId}/assignments?assignmentType=PRODUCT&ref.localizedName=Twix&ref.id=5c3348bda9812100098ffaa3&showUnpublished=true&withSubcategories=true&segmentsIds=segmentId1%2CsegmentId2&pageNumber=1&pageSize=60&sort={fieldName}%3AASC%2C{fieldName2}%3ADESC&hideUnpublishedProducts=false' \ -H 'Accept-Language: `*`, `en`, `en,de,fr`, `en-EN`, `fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7`' \ -H 'Authorization: Bearer ' \ -H 'X-Total-Count: true' \ -H 'X-Version: v2' ```
Specify the segment id in the request.
To add an individual product or a category, call the endpoint.
To assign multiple products or categories to the segment, call the endpoint.
To add a B2B customer, send the request to the endpoint.
To add a B2C customer, send the request to the endpoint.
To add multiple customers at once, send the request to the endpoint.
You can use the search API to find a segment of your interest that match a specific criteria. Send the request to the endpoint.
Optionally, you can offer a discount coupon to a customer segment. The coupon then applies only to the assigned products/categories and is valid only for the customers that are the segment members. To create a coupon that is valid only for a specific segment, send the request to the endpoint.
To display the content you want, first retrieve all the products/categories assigned to all segments that a customer is a member of. Send the request to the endpoint.
If you want to use segments to restrict the content on your storefront, to display only the product and categories assigned to a segment for segment customers, use the endpoint to build a segment-based category tree. Send the request to the endpoint.
To filter products that belong to a category that is assigned to a particular segment, send the request to the endpoint.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.