Jolt
Jolt
This is for:
DeveloperIn this article, we’ll introduce you to Jolt, what it’s used for, and its associated technical details.
What is Jolt?
Jolt is a lightweight library, deployed as an extension to smartserve.js, that listens for and sends all QProtocol events emitted on your website to Qubit’s Data Store. During the send, Jolt enriches each event with meta and context data.
You can read more about this in Event Enrichment.
Refer to the following examples and tables:
Example JavaScript for meta data
meta: {
url: 'https://www.mysite.com/uk',
trackingId: 'myproperty',
batchTs: 1522310723801,
type: 'myproperty.trView',
source: 'jolt@7.41.0',
id: 'cyeh53umxgg-0jfc8i02i-m0aw3v4',
bundleId: '2018-03-28T14:06:37@5b4d044@release-2018-03-19T10:00:00Z@2018-03-29T05:38:25',
seq: 6,
ts: 1522310723801
}
Schema for meta data
Field (JS Data Type) | Description |
---|---|
url (String) |
The current page URL the event was emitted from |
trackingId (String) |
The tracking Id for your property |
batchTs (Number) |
The timestamp for when the batch of events was sent to Qubit |
type (String) |
The event type that was enriched by Jolt |
source (String) |
The version of Jolt deployed on your site |
id (String) |
Random Id for the emitted event |
bundleId (String) |
The version and build of Smartserve |
seq (Number) |
A sequence that reports the number of events emitted by the visitor globally by device and site |
ts (Number) |
The client-side timestamp for when the event was emitted - will always be less than |
Example Javascript for context data
context: {
viewTs: 1522310723801,
sessionViewNumber: 2,
entranceViewNumber: 2,
lifetimeValue: {
value: 0
},
sample: '77542',
timezoneOffset: -60,
viewNumber: 2,
sessionTs: 1522310705008,
entranceTs: 1522310705008,
conversionCycleNumber: 1,
id: '8lt0vannbw8-0jfc8hl8v-xj2r3pc',
sessionNumber: 1,
entranceNumber: 1,
conversionNumber: 0
}
Schema for context data
Field (JS Data Type) | Description |
---|---|
viewTs (Number) |
A timestamp for the most recent view event |
sessionViewNumber (Number) |
The view number within the current session. A session is defined as any sequence of view events with less than 30 minutes between each view |
entranceViewNumber (Number) |
The view number within the current entrance. An entrance is defined as any sequence of view events where the first page comes from an external link, entered URL, or bookmark and where all subsequent pageviews are triggered by a selection within the site |
lifetimeValue.value (Number) |
The total amount transacted by the visitor over their lifetime - updated at the beginning of the next session |
lifetimeValue.currency (String) |
The ISO 4217 currency code for the user (for example, |
sample (String) |
A randomly generated hash of the context Id used for sampling |
timezoneOffset (Number) |
The timezone offset of the visitor in minutes from UTC |
viewNumber (Number) |
The number of view events across the user’s lifetime |
sessionTs (Number) |
Timestamp for when the session was initiated |
entranceTs (Number) |
Timestamp for when the entrance was initiated |
conversionCycleNumber (Number) |
The number of conversion cycles the visitor has had across their lifetime. The conversionCycleNumber increments only on the session following a session with one or more conversions |
id (String) |
Equivalent of visitor Id and cookie Id that is randomly assigned to each visitor to identify them on your site - device specific |
sessionNumber (Number) |
The number of sessions the visitor has had across their lifetime |
entranceNumber (Number) |
The number of entrances the visitor has had across their lifetime |
conversionNumber (Number) |
The number of conversions the visitor has made during their lifetime - updated on the next view event after a conversion |
Technical details
-
The library has a size of 23 kb
-
Jolt sends events asynchronously, so will not affect the end-user experience
-
Events that are emitted in a timespan of 500ms will be batched together into one request
-
All event data is compressed with Pako to ensure that the request payload is as small as possible
-
Compression allows a decrease of up to 95% in size for significant proportion of events
-
There is a maximum of 15 events that can be batched into one request. This ensures there are no site lock ups. When exceeding this limit, events are split into multiple requests
Requests
If Jolt is enabled on your site, a lookup request is made per visitor session to Qubit’s Data Store.
This is to ensure that all the important visitor information is available in the browser.
The URL of that request is lookup.qubit.com
.
Data inspection
To get a view of the data sent, call window.__qubit.jolt.events
in a console window.