The Segment Membership API returns a JSON object containing the segment Ids that a user belongs to.
Once you have built segments, you use the Segment Membership API to GET the segments that each and every site visitor belongs to. Segment membership is based on a range of conditions that you build into each segment. Conditions are the basic building blocks of a segment and are based on contextual and behavioral information. See Segments for more information about building segments.
The Segment Membership API gives you the power to target specific segments as part of your marketing strategy. Examples of segment based decisions include:
The Segment Membership API should be used where your users's membership state is unknown. Common examples include CMS systems and Mobile SDKs.
Qubit's technology must be integrated into your website before you can start segmenting visitors. See Getting Set Up
A data layer is crucial to getting better insights into site visitors and providing better on-site and app experiences. Qubit's data layer is called QProtocol.
On a technical level, the data layer serves to relay privacy aware visitor data to Qubit's Data Store, which is our data repository for quantitative and qualitative visitor data collected from your website.
Before using the Segment Membership API, you must first create your segments. Each segment is built using conditions that determine whether a user should be added to or removed from a segment.
See Segments for more information.
Before using the Segment Membership API, you will require the following unique values:
Name | Description | Additional Information |
---|---|---|
| Qubit tracking Id for the property the request is made from | This will be provided by your CSM |
| Unique site visitor Id, generated by the smartserve script on the page and is set in the cookies qb_permanent and qbTracker | You can extract this from the qb_permanent cookie using the regex /(^:+)/ |
Endpoint: https://segment-membership.qubit.com/
Called via a GET request:
GET https://segment-membership.qubit.com/p/<tracking_id>?visitorId=<visitor_id>&userId=<visitor_id>
GET https://segment-membership.qubit.com/p/union_fashion?visitorId=1479831298837.301540
{
segments: [
{ id: 'SG-4286-c58738a5' },
{ id: 'SG-4286-e84558b2' },
{ id: 'SG-4286-f437f311' }
]
}
{
error: {
message: 'Bad request'
}
}