--- title: "Web Tracking with the Xponent Web Tag" slug: "web-tracking-with-the-xponent-web-tag" updated: 2024-09-03T13:30:58Z published: 2024-09-03T13:30:58Z canonical: "help.csgi.com/web-tracking-with-the-xponent-web-tag" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.csgi.com/docs/llms.txt > Use this file to discover all available pages before exploring further. # Web Tracking with the Xponent Web Tag In the Xponent Journey Hub Graph API Listener, a screen like the one below is shown if the Web Tracking and Recommendation Listener type is chosen. There are a number of Tracking Options that can be selected, and these update the JavaScript tracking code shown below the buttons. This tracking code should be added to the header of any page on the website from which you wish to track activity. This is most typically performed with a tag manager. The JavaScript tag will automatically POST the activity to the graph into the schema location specified. ![](https://cdn.document360.io/c578bb14-e570-4b6e-93ed-f6c5b8a2d8a1/Images/Documentation/2024-09-03_16-10-47.png?sv=2026-02-06&spr=https&st=2026-10-26T14%3A20%3A28Z&se=2026-10-26T15%3A20%3A28Z&sr=c&sp=r&sig=hJjSAKnsU0We%2F15Vm9VXr2ch%2FD4MLdZ8U1Xg0GwyWMw%3D) The items that are tracked can be controlled in the `_kw.events` the object of the JavaScript. The allowed and default settings for the `_kw.events` object are as follows: | Attribute | Default | Description | | --- | --- | --- | | `_kw.events.trackViews` | true | Track page view events | | `_kw.events.trackClicks` | true | Track link click events ( tags) | | `_kw.events.trackForms` | true | Track form submit events | | `_kw.events.trackDropdowns` | true | Track change events on dropdowns ( ``` The settings from above would have the following effect: - The password field would not be tracked in a blur or included as a value in the form submit event because of the names setting - The clicks on the content div will not be tracked because of the id setting - The click on the link will not be tracked as it has the "doNotTrack" class - this is the recommended approach - The cookie "privateCookie" will not be returned as part of any packet If Do Not Track is enabled, and the setting is `allowList`, instead, the values will be treated as an “allow list” set. That is, ONLY those values set in the fields will be included in tracking. If an element does not match one of those, it will NOT be included in any tracking. ![](https://cdn.document360.io/c578bb14-e570-4b6e-93ed-f6c5b8a2d8a1/Images/Documentation/image2018-6-25_15-3-33.png?sv=2026-02-06&spr=https&st=2026-10-26T14%3A20%3A28Z&se=2026-10-26T15%3A20%3A28Z&sr=c&sp=r&sig=hJjSAKnsU0We%2F15Vm9VXr2ch%2FD4MLdZ8U1Xg0GwyWMw%3D) The above options would have the following effect on the HTML example. - ONLY the following would be tracking. - The input field with the name 'myText' because of the name settings - Clicks on the content div because of the id settings Caveats - If attempting to deny a list or allow a list a dropdown change event, it can only be included/excluded in its entirety.  Add the name, id, or class to the `<select>` tag.  Adding an id, name, or class to only selected `<option>` tags within a `<select>` tag has no effect. ### Web Components and Custom Element Tracking WebTrack version 5 adds two additional options for use within `_kw.options` to allow for tracking of Web Components and custom elements. | **Attribute** | **Type** | **Description/Comment** | | --- | --- | --- | | `elementPrefix` | String | The prefix before the HTML element name. This prefix will be "injected" into the `webTrack` script to essentially create input, select, and other HTML elements that don't natively exist. | | `selectors` | Array | Used to define any other custom elements that don't necessarily fit the pattern. | Examples of `elementPrefix` usage: - component name is `bx-input`, the `elementPrefix` is `bx` - component name is `ui5-select`, the `elementPrefix` is `ui5` - component name is `bolt-textfield`, the `elementPrefix` is `bolt` Supported input types for `elementPrefix`: - input - text field - textarea - select - radio - radio-group - radio-button - checkbox If the component library does not follow these naming conventions or a custom component is being used, add the names to `selectors` and Web Track will be able to track those components. ### Submitting Form Data In order for elements to be considered valid form controls for submission, each input *MUST* have a name attribute. This follows standards set by The World Wide Web Consortium (W3C). ```markup ``` [Form Submission](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.2) 17.13.2 Successful controls: *A successful control is "valid" for submission. Every successful control has its control name and current value as part of the submitted form data set. A successful control must be defined within a FORM element and must have a control name.* ### Tracked Input Types Fields that are not tracked and not included in `formData` (submitted data): disabled fields - fields without a name attribute - password fields (password fields will also not be tracked on any type of event) - radios or checkboxes that are not checked/selected or have a values - select (dropdown) components without an option selected ## Web Tracking JSON Structure ```javascript { "cookies": { "kw-fingerprint-b17bc362301beb8a84e7347c7e666d84": "a10f0746dfd7d9bc3c16c3929682f13d", "kw": "89fba850-914d-11e7-ac47-bbc724996795", "kw-session-b17bc362301beb8a84e7347c7e666d84": "97c99ce0-97a5-11e7-83f1-6be334c9a090" }, "tag": null, "href": null, "tagName": null, "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", "kwSession": "97c99ce0-97a5-11e7-83f1-6be334c9a090", "epochTs": 1505212429690, "eventtype": "view", "winHeight": 960, "tagData": null, "formdata": null, "kwFingerprint": "a10f0746dfd7d9bc3c16c3929682f13d", "winWidth": 1920, "scrollPctHor": "0.00", "kwCookie": "89fba850-914d-11e7-ac47-bbc724996795", "timestamp": "2017-09-12 11:33:49.685", "tagId": null, "scrollPctVer": "0.00", "dropdown":{"name":"unnamed dropdown","value":"audi"}, "eventtype":"change", "geoloc": { "timestamp": null, "coords": { "altitude": null, "longitude": null, "latitude": null, "altitudeAccuracy": null, "speed": null, "heading": null, "accuracy": null } }, "mouseY": null, "mouseX": null, "_kw": { "headers": { "origin": "http://yourdomain.com", "content-length": "998", "accept-language": "en-GB,en;q=0.8", "accept-encoding": "gzip, deflate, br", "x-forwarded-port": "443", "x-forwarded-for": "0.0.0.0, 0.0.0.0", "accept": "application/json, text/javascript, */*; q=0.01", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", "host": "api.kitewheel.com", "x-forwarded-proto": "https", "referer": "www.google.com", "x-real-ip": "0.0.0.0", "content-type": "application/json; charset=UTF-8" }, "method": "POST" }, "url": "http://yourdomain.com", "referrer": "www.google.com", "extras": {} } ``` | Attribute | Type | Description/Comment | | --- | --- | --- | | `tag` | String | The HTML element type e.g. FORM, BUTTON, etc | | `href` | String | If a link is clicked, this indicates where the user is going to. | | `tagName` | String | The name attribute of the HTML element is set. null otherwise. | | `userAgent` | String | The browser provides the user agent string. This is also given in the `_kw.headers` property. | | `kwSession` | String | The Xponent session identifier which is based on a session cookie. Be aware that many browsers retain session cookies across "sessions" if the user has selected an option such as Google Chrome's On Start Up → Continue Where you left off preference. Other browsers support similar options. | | `epochTS` | Numeric | The epoch timestamp for the event is in milliseconds since 00:00:00 [Coordinated Universal Time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time) (UTC), Thursday, 1 January 1970. This is 13 digits in length as it is calculated in milliseconds. The Xponent tracking code calculates this and may well be different from the timestamp field, which comes from the browser in local time. | | `eventtype` | String | The web track event type one of: view, click, formSubmit, blur, change (for dropdowns). All these event types can be turned on or off on the Xponent Javascript. | | `winHeight` | Numeric | The height of the browser window in screen pixels | | `tagData` | String | If the event type is "blur," then this will contain the blur data of the HTML element - typically the form field value. | | `formdata` | Array of name/value object | If the event type is formSubmit, then this JavaScript array will be populated with an array of name/value pair objects, one for each form field. | | `kwFingerprint` | String | The device fingerprint is an optional value that can be tracked using the Xponent tag. It combined 30 to 40 attributes on the machine and browser to identify it uniquely. | | `winWidth` | Numeric | The width of the browser window in screen pixels | | `scrollPctHor` | String | Percentage by which the page has been scrolled left within the browser window as a percentage. Some browsers return this as a number greater than 100, which should be divided by 100 to get the percentage. | | `kwCookie` | String | The tracking JavaScript allocates the Xponent cookie. This is a globally unique identifier of a length of 37 characters. | | `timestamp` | String | The timestamp given by the browser - this is local time to the browser. See also epochTs | | `tagId` | String | The id attribute of the HTML element if set. null otherwise. | | `scrollPctVer` | String | Percentage by which the page has been scrolled down within the browser window as a percentage. Some browsers return this as a number greater than 100, which should be divided by 100 to get the percentage. | | `dropdown` | Object | If the `trackDropdowns` the option is set to true, then DOM 'change' events will populate the dropdown attribute of the JSON object sent to the graph. This will be populated with an object containing the name of the dropdown and the value of the selection. The name of the dropdown will be the name on the