Experience API
Updating and receiving information of a user profile.
The Experience API is the core of Ninetailed. It returns profiles, JSON representations of visitors and their activity, in response to events. The Experience API is highly performant because of it's deployment on the edge.
Endpoints
Batch Creating or Updating User Profiles
You might also use the endpoints of this API to push data from your own existing customer data systems into Ninetailed profiles in real time, in periodic batches, or in bulk as part of a first-time migration.
This endpoint upserts profiles, meaning that when events are passed for profile IDs that do not yet exist profiles at those IDs will be created. This ensures that you do not have to check whether profiles at specific IDs exist prior to migration.
This endpoint is intended to be used server-side. Because of that, it does not accept options to related to resolving location or IP address. You may, however, still specify location data on events.
This endpoint accepts up to 200 events, with a maximum of 50 identify
events, across a maximum of 50 unique profiles.
Tips
We highly recommend that you use the
profileID
that is returned by the Ninetailed profile once you have identified the user. Retrieving and updating profiles with this returned ID is more performant than using an ID you have supplied when creating or aliasing a profile.The payload you supply to these endpoints can be sent with the
content-type
header set as eitherapplication/json
ortext/plain
. We recommend that you usetext/plain
whenever possible to minimize request roundtrip time by avoiding triggering a CORS preflight request. Our SDKs automatically send requests astext/plain
.If you want to ensure that a user's location is not resolved is part of a create profile or update profile endpoint request, you can either:
Set an empty string or object, whichever is applicable, to each
context.location
argument, ORNot set
location
or supplylocation: undefined
orlocation: {}
, do not supplylocation
as an option, and setcontext.library.version
to a string that represents a semver of3.14
or greater.
Types
Response
The returned response of each API endpoint is a data structure indicating the complete representation of the profile(s) and the Ninetailed Experiences & variants that the Experience API has selected for the profile(s). Endpoints that only alter one profile (Create, Update, and Get), only a single profile is returned, while the Batch Upsert Profile Point returns an array of altered profiles.
Profile
A profile is a a wholistic representation of a single user. The Ninetailed Experience API computes and returns a visitor's profile
in response to page
, track
, and identify
events. The profile is also used within Ninetailed's Experience SDKs to determine the appropriate experience variants and Merge Tag values to render.
Experience
Each response from the Experience API also returns an array of experience assigned to the profile. you may see this typed in the SDKs as `SelectedVariantInfo Experiences must be published in the content source to be returned on the Experience API. Each experience indicates the variant index (0 = control, 1 = variant 1, etc.) and the content source IDs of content to show.
The key of each variants
Record is the content source's ID of the baseline or control content. The value of each variant Record is the content source's ID of the applicable variant content. When the variant index is 0, the key and value are the same, otherwise they will be different.
Event
Each POST endpoint accepts arrays of events as part of requests. Events are the building blocks of profiles; they indicate the actions taken and attributes of individual profiles so those profiles can be segmented into Audiences.
Options
The API endpoints also accept options to modify the behaviour of the request. These are available only on the create profile and update profile endpoint (not the batch upsert endpoint).
Specifying
location
will attempt to resolve the location of the user based on the IP of the request and where it ingresses to the Experience API.If you do not want location to be resolved when sending events, do not add
location
as a feature option and ensure thatcontext.library.version
is set on any accompanying event as a string representing a semver greater than3.14
Specifying
ip-enrichment
will attempt to resolve firmographic data with a connected Albacross API Key. See Albacross for more information.
Traits
traits
are arbitrary JSON data set by identify
events. Traits are shallow merged together; the most recent value of a given trait key overwrites the prior value.
Traits are useful for custom segmentation using has trait
rules. Additionally, traits can serve as snippets for dynamic inline personalizations.
Example for an inline Personalization:
const headline = `Hey ${profile.traits.firstname}👋`
.
Last updated