The Context Object
15 min
every analytics event in the chord cdp carries a context object alongside its properties while properties describe what happened in the event, context describes the environment in which it happened — the page, the user's device, their location, and any identity traits that have been associated with them destination plugins use context fields as fallback sources when event properties are not present for example, a user's email set via an identify call will be available on all subsequent track events as context traits email how context is populated context fields come from three sources automatically by the chord sdk (client side) the browser sdk populates these fields on every event without any extra configuration context page — current url, path, referrer, title context useragent — browser user agent string context locale — browser locale (e g en us ) context library — sdk name and version context screen — screen dimensions and density context campaign — utm parameters parsed from the url context clientids — third party client ids (ga4, facebook, amplitude) read from cookies from identify calls when your code calls identify(userid, traits) , the traits are stored and attached to all subsequent events as context traits this is the mechanism that makes user attributes like email, name, and address available on track events without repeating them in every event's properties server side enrichment chord's processing layer enriches events with context ip — the originating ip address context geo — geolocation data derived from the ip (country, region, city, coordinates) schema reference context page url and navigation context for the current page populated automatically by the browser sdk field type description url string full page url path string url path component host string hostname referrer string referrer url referring domain string referrer hostname search string query string title string page title context traits user traits from the most recent identify call these persist across events for the browser session destination plugins use these as fallbacks when event properties do not carry the same information standard traits field type description email string user email address phone string phone number first name string first name last name string last name name string full name address object see address schema below context traits address the standard address schema for context traits address aligns with the chord tracking plan address conventions field type description address1 string street address line 1 address2 string street address line 2 city string city state string state or province country string country zipcode string postal / zip code name string recipient name company string company name phone string address specific phone number note the event extractor also recognises legacy field names as fallbacks — street for address1 , street2 for address2 , and zip / postalcode for zipcode these are supported for backwards compatibility but address1 , address2 , and zipcode are the canonical names context clientids third party tracking ids read from browser cookies field type description ga4 clientid string google analytics 4 client id ga4 sessionids any ga4 session ids fbc string facebook click id (from fbc cookie) fbp string facebook browser id (from fbp cookie) amplitudesessionid number amplitude session id (unix ms) amplitudedeviceid string amplitude device id context campaign utm parameters parsed from the page url field type description name string utm campaign source string utm source medium string utm medium content string utm content term string utm term context geo server side geolocation data enriched from the request ip not populated on client side events before rotor processing field type description country code string iso 3166 1 alpha 2 country code country name string country name region code string region / state code region name string region / state name city name string city name location latitude number latitude location longitude number longitude context device mobile device information populated by mobile sdks; typically absent for browser events field type description id string device id type string device type (e g ios , android ) manufacturer string device manufacturer model string device model name string device name advertisingid string advertising id (idfa / gaid) adtrackingenabled boolean whether ad tracking is enabled token string push notification token context os operating system information populated by mobile sdks field type description name string os name (e g ios , android ) version string os version string context network network information populated by mobile sdks field type description carrier string mobile carrier name wifi boolean whether connected via wifi cellular boolean whether connected via cellular bluetooth boolean whether bluetooth is on context screen screen dimensions populated by the browser sdk and mobile sdks field type description width number screen width in pixels height number screen height in pixels density number pixel density (device pixel ratio) context app application metadata populated by mobile sdks field type description name string app name version string app version build string build number namespace string app namespace / bundle id other fields field type description ip string originating ip address (server enriched) useragent string browser or sdk user agent string locale string browser locale (e g en us ) library name string chord sdk name library version string chord sdk version