context
The context
property is an array of strings that determines what the Web SDK can automatically collect. While this data can provide great value, omitting some of this data can be beneficial so that you can comply with your organization’s privacy policy.
Context keywords and XDM elements
If you include a given context keyword, the Web SDK automatically populates all of its associated XDM elements. If you want to omit a specific XDM element while allowing others, you can clear values out using onBeforeEventSend
. If you send multiple events on a page, the Web SDK includes these fields on every SendEvent
call.
Web
The "web"
keyword collects information about the current page.
xdm.web.webPageDetails.URL
https://example.com/index.html
xdm.web.webReferrer.URL
http://example.org/linkedpage.html
Device
The "device"
keyword collects information about the user’s device.
xdm.device.screenHeight
900
xdm.device.screenWidth
1440
xdm.device.screenOrientation
landscape
or portrait
Environment
The "environment"
keyword collects information about the user’s browser.
browser
.xdm.environment.type
browser
xdm.environment.browserDetails.viewportHeight
679
xdm.environment.browserDetails.viewportWidth
642
Place context
The "placeContext"
keyword collects information about the user’s location.
xdm.placeContext.localTime
YYYY-08-07T15:47:17.129-07:00
xdm.placeContext.localTimezoneOffset
360
xdm.placeContext.geo.countryCode
US
xdm.placeContext.geo.stateProvince
CA
xdm.placeContext.geo._schema.latitude
37.3307447
xdm.placeContext.geo._schema.longitude
-121.8945965
Timestamp
The timestamp
keyword collects information about the timestamp of the event. This part of context cannot be removed.
xdm.timestamp
2019-08-07T22:47:17.129Z
Implementation details
The implementationDetails
keyword collects information about the SDK version used to collect the event.
xdm.implementationDetails.name
https://ns.adobe.com/experience/alloy
. When the library is used as part of the tag extension, the value is https://ns.adobe.com/experience/alloy+reactor
.xdm.implementationDetails.version
+
. For example, if the library version is 2.1.0
and the tag extension version is 2.1.3
, the value would be 2.1.0+2.1.3
.browser
.xdm.implementationDetails.environment
browser
High entropy client hints high-entropy-client-hints
The "highEntropyUserAgentHints"
keyword collects detailed information about the user’s device. This data is included in the HTTP header of the request sent to Adobe. After the data has arrived within the Edge network, the XDM object populates its respective XDM path. If you set the respective XDM path in your sendEvent
call, it takes precedence over the HTTP header value.
If you use device lookups when configuring your datastream, data can be cleared out in favor of device lookup values. Some client hint fields and device lookup fields cannot exist in the same hit.
Sec-CH-UA-Platform-Version
xdm.environment.browserDetails.
userAgentClientHints.platformVersion
10.15.7
Sec-CH-UA-Arch
xdm.environment.browserDetails.
userAgentClientHints.architecture
x86
Sec-CH-UA-Model
xdm.environment.browserDetails.
userAgentClientHints.model
Intel Mac OS X 10_15_7
Sec-CH-UA-Bitness
xdm.environment.browserDetails.
userAgentClientHints.bitness
64
Sec-CH-UA
also collects this element.Sec-CH-UA-Full-Version-List
xdm.environment.browserDetails.
userAgentClientHints.vendor
Google
Sec-CH-UA
also collects this element.Sec-UA-Full-Version-List
xdm.environment.browserDetails.
userAgentClientHints.brand
Chrome
Sec-CH-UA
also collects this element. Exact browser version is not automatically collected.Sec-UA-Full-Version-List
xdm.environment.browserDetails.
userAgentClientHints.version
105
Collect context information using the Web SDK tag extension
The context information setting is a combination of radio buttons and check boxes when configuring the tag extension. Each checkbox maps to a context keyword.
- Log in to experience.adobe.com using your Adobe ID credentials.
- Navigate to Data Collection > Tags.
- Select the desired tag property.
- Navigate to Extensions, then click Configure on the Adobe Experience Platform Web SDK card.
- Scroll down to the Data Collection section, then select either All default context information or Specific context information.
- If you select Specific context information, enable the check box next to each desired context information element.
- Click Save, then publish your changes.
Collect context information using the Web SDK JavaScript library
Set the context
array of strings when running the configure
command. If you omit this property when configuring the SDK, all context information except "highEntropyUserAgentHints"
is collected by default. Set this property if you want to collect high entropy client hints, or if you want to omit other context information from data collection. Strings can be included in any order.
context
array string. The default context
value omits highEntropyUserAgentHints
, and if you set the context
property, any omitted values do not collect data.alloy("configure", {
datastreamId: "ebebf826-a01f-4458-8cec-ef61de241c93",
orgId: "ADB3LETTERSANDNUMBERS@AdobeOrg",
context: ["web", "device", "environment", "placeContext", "highEntropyUserAgentHints"]
});