Please include ONE of the following script reference and replace the placeholders with your API credentials.
Include Only ONE of the above script references.
Once the event tracking API is initialized, automatic Page level events are captured and streamed automatically without any additional code.
In the application that will be streaming the data, initialize the Qualetics API object using the following initialization script.
Replace the placeholders APPLICATION_ID, APPLICATION_SECRET and CLIENT_ID with the API credentials provided to you or generated from the Qualetics portal. See Creating your account
The following options can be set while initiating the connection.
Host that tracker will connect to Defaults to wss://api.qualetics.com
Port that tracker will connect to Defaults to 443
Default actor for all the messages.
This can be the actor information once logged in and will retain for all further automatic page view tracking.
Custom events will still require an Actor object.
Store sessionId as cookie,
If a stored sessionId has a different session prefix than what is configured, a new session id will be generated and it will be stored. Defaults to true, only usable on browser.
Store default actor from api call. This setting will have no effect if default actor setting is set. Defaults to true, only usable on browser.
Include users geolocation information as metadata.
This will prompt an alert to the user and requires their approval to track locations. Defaults to false, only usable on browsers.
Track users page exits and returns automatically. Defaults to true
Version number or the code of the application using the SDK No Default value
Automatically captures all JS and HTTP errors when using the JS SDK. Defaults to false
When true, all click events are automatically captured. Defaults to false.
When true, the page load times are automatically captured. Defaults to false.
Example Initialization Script
Custom Event Creation
In addition to automatic tracking, Qualetics API allows you to track custom events from your application enabling you to gather data for specific events.
Examples of such events are -
- A user performing a Login action in your application
- Adding a Product to the cart
- Completing a Purchase
- Adding a Product Review
- Performing a Search for a specific item
Such events can contain valuable data that can aid to understanding your application and also help with additional data collection. Following is an example of how such events can be captured using the entities of Actor, Action, Context and Object.
The Event can be sent either by sending the complete JSON object
Using the builder message builder
All Automatic and Custom Events will be processed and available as insights in the Portal created.