Developer Framework settings
Before you start
- You need the Power User or Site Administrator role to edit the MasterPage JavaScript.
Note: The Developer Framework lets you customise and extend your intranet with your own JavaScript, CSS and apps. Examples in these pages are samples, not officially supported by Interact Technical Support, and should be reviewed and tested by your development team before use.
Overview
Interact Advanced Analytics supports configuration through the Developer Framework. This lets you enrich the data and events captured by Advanced Analytics, for example by adding custom fields, controlling session length, or excluding certain user groups.
Settings and custom fields
The code snippet below shows all available options.
// Optional Variables
// Default: 30 minutes
var sessionDuration = 30; // Time before resetting the interaction chain
// All user behaviour is tracked unless they are a member of one of the following
// List of primary company names to not track (case sensitive)
var excludedCompanies = [];
// List of primary location names to not track (case sensitive)
var excludedLocations = [];
// List of primary department names to not track (case sensitive)
var excludedDepartments = [];
// Optional Function
// Allows you to set the CustomFields to enrich the tracked data
var populateCustomFields = function (event, person, callback) {
// Alternatively you can just use the supplied person object
event.CustomField1 = person.AdditionalFields["WorkdayID"];
event.CustomField2 = person.JobTitle;
// Make sure to call the callback, or event won't be tracked
return callback(event);
// You could also use $.ajax to get data from any other APIs to retrieve additional information, and then call the callback function to track the event
}
Custom events
For example, you might want to track every click of the HR - Help button so that you can analyse the trends and needs internally.
This lets you segment the analytics data and analyse events specific to your organisation and use cases.
Custom events behave the same as the out-of-the-box events. They contain custom fields and are subject to exclusions.
Track a custom event by calling this function.
TrackerNew.logEvent("My Custom Event");
This line sends an event to Interact Advanced Analytics with the eventName field set to "My Custom Event".
Note: There are more examples of capturing events in the left-hand menu. Expand the Developer Framework Settings category to find them.