Implementing DOM capture involves configuring your application to be "DOM-enabled" and configuring Tealeaf to process and replay sessions of visitors that use the DOM-enabled application.
Before you enable DOM capture and replay:
- Understand the pros and cons of using DOM capture.
- Get classic capture to work first for your application.
This task describes the end-to-end configuration procedure for a DOM capture and replay solution. The procedure includes steps for configuring DOM capture on the client side and for enabling the replay of DOM captured data on the server side.
Action | Description |
---|---|
Enabling DOM Capture | You can log full DOM captures or DOM diffs. DOM diff is an enhancement to the DOM capture feature. The default setting for DOM diffs is enabled.
Note: DOM diff functionality is not supported within hybrid mobile apps. ScreenViews and DOM snapshots are used to replay sessions from hybrid mobile apps.
DOM capture is enabled for an individual page by adding a DOM-capture trigger event to the page. The classic Capture process is used to capture any page that is not configured with a DOM-Capture trigger event. |
Adding triggers for page load, page unload, click, and change | A trigger tells the UIC when to do a DOM Capture. For initial setup and testing, you want to perform a DOM capture on every page load and unload, on every click, and on every change event. After you test your setup and verify that DOM capture is working, you want to tune the trigger events to capture only specific data. |
After you verify that the DOM capture feature is enabled and working in replay, you determine if DOM Diff is affecting performance and fine-tune triggers for capture. Depending on the application, there may be so many DOM Diffs to process that the performance is affected. In that case, you may want to disable DOM Diff and use a full DOM capture.
In a production environment, to capture every screenview load and unload and every click or change on a control would be such a large amount of data that it would cause performance issues. You might need to limit the captures to specific clicks and changes. You can create custom triggers to limit the DOM capture to specific user actions.
- Pre-defined event triggers - The click, load, unload, change - you can trigger a DOM capture on the click of a specific button or the load of a specific screenview. After you assign an event to a specific control or screenview event, the system stops capturing a DOM snapshot for every event of that type. For example, defining a trigger as click without specifying a control means that a DOM capture is triggered on every click event. Specifying a control for the click, such as the Next button, means that DOM captures are only triggered when the user clicks a Next button.
- Custom event triggers - You can define a custom event in the replay module configuration and use that event to trigger a DOM capture. For example, you can create a custom event that is called Login and use the Login event to trigger a DOM capture.
Configuring DOM capture on the server-side involves enabling DOM Capture on the Replay server, increasing the byte size specified in the Canister Safety Limits [BB] Event, and adding a DOM Capture Virtual Session Agent to the pipeline.
- Extracting DOM or DOM Diff from type 12 message.
- Creating a virtual hit with extracted DOM or DOM Diff being the response.
- Inserting the newly created virtual hit into the session.
- Sending the processed data to the Canister.
At replay time, the Replay Server pulls the session that contains virtual hits.
Additionally, the DOM Capture Virtual Session Agent ensures the seamless integration of the DOM or DOM Diff with existing Tealeaf features, such as search index and privacy.
- Configure DOM Capture on the client side:
- Start the configuration wizard for the application that you are using with Tealeaf.
- On the DOM Capture page, select Enable DOM Capture.
- If you want to use Hybrid Mobile replay, remove the DOM Diff selection from the DOM Capture page.
- Add four triggers, one each for load, unload, click, and change:
- Select Add trigger. Leave the Event drop-down at Load, and the Screenview and Delay fields blank.
- Select Add trigger. Change the Event drop-down to Unload. Leave the Screenview and Delay fields blank.
- Select Add trigger. Change the Event drop-down to Click. Leave the ID, ID Type, CSS Selector, and Delay fields blank.
- Select Add trigger. Change the Event drop-down to Change. Leave the ID, ID Type, CSS Selector, and Delay fields blank.
- Select Finish.
- Configure the Replay server session agent for DOM captured data:
- Use TMS to add the DOM Capture Virtual Session Agent.
- Log on to the Portal as an administrator.
- From the menu bar, navigate to TMS.
- From the Worldview tab, expand the twistie so that you can see all of the nodes in the server view.
- Expand the Transport Service node.
- Scroll to the Transport Service configuration and select it.
- In the Config Actions section of the panel, select View/Edit.
- In the Available Session Agents panel, locate DOMCaptureVHit and select it.
- With DOMCaptureVHit selected, drag it to the panel on the left and drop it between the Inflate and PrivacyEX session agents.
- In the Edit Session Agent dialog, select Add Config Items and select DownStreamConfigSection.
- Click OK.
- Click OK again.
You created and configured the DOM Capture Virtual Hit Session Agent by using TMS. - Enable the Replay server to play captured DOM data:
- Log in to the Portal as an administrator.
- From the menu bar, navigate to TMS.
- From the Worldview tab, expand the twistie so that you can see all of the nodes in the server view.
- Expand the Replay Server node and select the server on which to enable DOM capture.
- In the Config Actions section of the panel, select View/Edit.
- Locate the property that is named EnbableDomCapture and select it.
- In the Edit Config Item window, set a value of
1
and click Apply
You enabled the Replay of captured DOM or DOM Diff data on the server. - Consider changing the byte size of the Canister Safety Limits [BB] Event.
When DOM Capture is enabled, you will likely need to increase the byte size specified in the Bytes section of the Canister Safety Limits [BB] Event.
The Canister Safety Limits [BB] event closes the session if the session is too long, too large, or has too many hits. Because DOM Capture can incur additional processing and network transmission cost, you might need to increase the byte size to accommodate these costs and to prevent the session from splitting too early.
The amount by which to increase the byte size varies depending on the website and on how DOM capture is utilized. Consult Professional Services for advice about increasing the byte size of the Canister Safety Limits [BB] Event.
To increase the byte size specified in the
Bytes
section of the Canister Safety Limits [BB] Event:- From the Portal, select Configure > Event Manager.
- From the Filter Events panel, select Standard Events.
- Sort the list of standard events by name to find the
Canister Safety Limits [BB]
event in the view area. - Right-click the
Canister Safety Limits [BB]
and select Edit Event.The following figure shows the Canister Safety Limits [BB]. The text in bold indicates the value that needs to be increased if DOM Capture is enabled.// Canister Safety Limits [BB] function PALI$E_SAFETY_LIMITS() { //Default: 2048 Hits if ($S.NumberOfHits > 2048) TLCloseSession.CloseForSafetyHits(); //Default: 5242880 Bytes (5MB) if (($S.TotalREQBytes + $S.TotalRSPBytes) > 5242880) TLCloseSession.CloseForSafetySize(); //Default: 3600 Seconds (60 minutes) if ($S.TotalTime> 3600) TLCloseSession.CloseForSafetyTime(); }
- After increasing the default byte size, click Validate Javascript to ensure change is valid.
- Click Save Draft.
- Click on the Events tab and click Save Changes to commit the change.
- Use TMS to add the DOM Capture Virtual Session Agent.
- Refine the DOM capture triggers on the client side, in your application:
- Use a specific page or control to trigger a DOM capture, for example, when the application user clicks on the Next button:
- In the Configuration wizard in your application, go to the DOM Capture page.
- Remove all of the triggers that you are no longer using.
- Set the Event drop-down to Click.
- Enter the ID for the control that you want to capture on a user click.
- Enter the ID type for the control.
- Enter a delay, in milliseconds, that you want the application to wait before it takes the DOM capture.
- Use a custom event to trigger a DOM capture, for example Login:
- In the Configuration wizard in your application, go to the Module page.
- Select the Add a Custom Replay Event.
- Enter the Event name.
- Enter the Event Target..
- Enter the Event State.
- Select Next to go to the DOM capture page.
- Remove the triggers that you no longer want to use.
- Select Add Trigger.
- Select the custom Event that you created from the Event drop-down.
- Enter the configuration information.
- Select Finish.
- Use a specific page or control to trigger a DOM capture, for example, when the application user clicks on the Next button: