Add hotspots to track custom widget performance
task australia Updated Sep 10, 2026 1 min read add-hotspots-track-custom-widget-performance.md
Hotspots help capture and log widget load times, which enables better debugging of long portal load times.
Before you begin
Role required: sp_admin
Procedure
-
Navigate to All > Service Portal > Widget.
-
Click the custom widget you want to add the hotspot to.
-
Insert the following code snippets into the Server script field:
Define a start time below the loading configuration expression:
JavaScriptvar startTime = new GlideDateTime();Retrieve widget instance identifier:
JavaScriptdata.spInstanceId = grInstanceRecord.getUniqueValue();Add load time tracking:
JavaScriptnew sn_cd.cd_Utils().postInstanceHotspot({ startTime: startTime, callerId: data.spInstanceId, shortDesc: '{insert a short description}' }); -
Click Update.
What to do next
Open the Performance details window to view how long the custom widget takes to load data: View widget performance metrics
Parent Topic:Managing portal performance
63 lines · 2.1 KB
---
title: Add hotspots to track custom widget performance
description: Hotspots help capture and log widget load times, which enables better debugging of long portal load times.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/employee-service-management/employee-experience-foundation/add-hotspots-track-custom-widget-performance.html
release: australia
product: Employee Experience Foundation
classification: employee-experience-foundation
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Managing portal performance, Configuring Employee Center Pro, Employee Center Pro, EmployeeWorks, Employee Service Management]
---
# Add hotspots to track custom widget performance
Hotspots help capture and log widget load times, which enables better debugging of long portal load times.
## Before you begin
Role required: sp\_admin
## Procedure
1. Navigate to **All** > **Service Portal** > **Widget**.
2. Click the custom widget you want to add the hotspot to.
3. Insert the following code snippets into the **Server script** field:
Define a start time below the loading configuration expression:
```
var startTime = new GlideDateTime();
```
Retrieve widget instance identifier:
```
data.spInstanceId =
grInstanceRecord.getUniqueValue();
```
Add load time tracking:
```
new sn_cd.cd_Utils().postInstanceHotspot({
startTime: startTime,
callerId: data.spInstanceId,
shortDesc: '{insert a short description}'
});
```
4. Click **Update**.
## What to do next
Open the Performance details window to view how long the custom widget takes to load data: [View widget performance metrics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/employee-experience-foundation/view-widget-performance-metrics.md)
**Parent Topic:**[Managing portal performance](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/employee-service-management/employee-experience-foundation/improve-manage.md)
| title | Add hotspots to track custom widget performance |
| description | Hotspots help capture and log widget load times, which enables better debugging of long portal load times. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/employee-service-management/employee-experience-foundation/add-hotspots-track-custom-widget-performance.html |
| release | australia |
| product | Employee Experience Foundation |
| classification | employee-experience-foundation |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Managing portal performanceConfiguring Employee Center ProEmployee Center ProEmployeeWorksEmployee Service Management |