Skill Level: Intermediate
Normally, the UI Capture SDK library is required to capture all user interaction from page load to page unload. However, in certain application situations, it may be desirable to initiate and terminate this capture functionality depending on various runtime variables.
For example, consider an application that requires user consent before it begins capturing analytics data. In such a case, the application can choose to implement its application specific user interface to obtain such a consent. If consent is given then the application can invoke the initialization process of the UI Capture SDK.
Replace the anonymous self-executing function which invokes the TLT.init() API with a named function which can be called at a later stage from within the application.
With this change, the UI Capture SDK will not initialize automatically on page load.
Rather, the named function initTealeafUIC() has to be explicitly invoked by the application in order to initialize the UI Capture SDK. The application can choose to invoke this function based on any runtime condition.
Once initialized, the UI Capture SDK will continue operation until page unload. To terminate the UI Capture SDK at any time, invoke the TLT.destroy() API.