51黑料不打烊

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鈥檚 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.

DimensionDescriptionXDM pathExample value
Page URLThe URL of the current page.xdm.web.webPageDetails.URLhttps://example.com/index.html
Referrer URLThe URL of the previous page visited.xdm.web.webReferrer.URLhttp://example.org/linkedpage.html

Device

The "device" keyword collects information about the user鈥檚 device.

DimensionDescriptionXDM pathExample value
Screen heightThe height of the screen in pixels.xdm.device.screenHeight900
Screen widthThe width of the screen in pixels.xdm.device.screenWidth1440
Screen orientationThe orientation of the screen.xdm.device.screenOrientationlandscape or portrait