The Dynamic Number Insertion (DNI) test failed and is showing an error. How can I tell if ServiceTitan’s DNI is working?

Prev Next

Problem

The Dynamic Number Insertion (DNI) test failed and you want to know how to check if ServiceTitan's DNI is working.

Note: While ServiceTitan's Marketing Ads feature does support using third-party DNI, this article is for troubleshooting ServiceTitan's DNI and does not apply to third-party DNI platforms. You can use either ServiceTitan's DNI or a third-party DNI, but not both at the same time.

Solution

Step 1: Check if the website domain under Step 1 of DNI installation matches the URL of the website

The website domain needs to be an exact match of the actual URL of the website where the ServiceTitan DNI code is installed.

For example, if the company's full website URL is https://www.company.com, then the Website Domain field in the Setup Website and Phone Number step of the DNI process should be entered as www.company.com instead of just company.com. If the company's full website URL is https://company.com, then the Website Domain field should be entered as company.com.

Step 2: Make sure ServiceTitan's DNI code is only installed once on the company website

Duplicate DNI codes will cause issues. To check this:

  1. Go to the company website.

  2. Right-click anywhere on the page and select Inspect.

  3. In the developer console that opens, click the Elements tab.

  4. Click any blank space under the Elements tab then press Command + F (Mac) or CTRL + F (PC) on your keyboard and search for ServiceTitanDNI.

  5. Make sure there's only one result.
    developer console

Step 3: Make sure no third-party DNI codes are installed on the website at the same time as ServiceTitan's DNI code

Third-party DNI codes will conflict with ServiceTitan's DNI code. An indication that third-party DNI is installed is when the website's advertised number swaps to a tracking number that doesn't exist in ServiceTitan Phone Settings. To check for third-party DNI codes:

  1. Go to the company website.

  2. Right-click anywhere on the page and select Inspect.

  3. In the developer console that opens, click the Sources tab.

  4. Look for any third-party DNI functions, such as Gstatic, CallRail, CallTracking Metrics, and so on. Here's an example of a third-party DNI installed on the website:
    third-party DNI

  5. If there's a third-party DNI installed on the website, have your web developer make sure it's completely removed for ServiceTitan's DNI code to work. If you don't plan on using the third-party DNI going forward, make sure to also cancel your subscription with them.

  6. If it seems like a third-party DNI is in effect but you can't find any third-party DNI functions or codes on the website, have your web developer check whether Google Tag Manager (GTM) is injecting a third-party DNI code.        

    Note: If this is happening, you won't be able to see the code directly on the website. You'll need to go to Google Tag Manager directly and remove the code injection there. See this Google article for steps on how a custom code would have been installed via GTM.

Step 4: Check how the advertised phone number is coded on the company website

ServiceTitan's DNI requires the advertised number to be wrapped in an HTML element on the site. If the advertised number is added to the site as plain text instead of HTML, ServiceTitan's DNI script can't swap out the number. The recommended formatting for clickable numbers is tel:8888888888.

Here's an example of an incorrectly coded advertised number. It's added as plain text, but it's not directly wrapped in an HTML element:

incorrectly coded

Here's an example of a correctly coded plain text advertised number. It's directly wrapped in an HTML element:

correctly coded

Step 5: Check for lazy load on your website

If your website uses lazy loading, make sure the ServiceTitan DNI code starts before the lazy loading process begins. Do not include the ServiceTitan DNI script in your website's lazy load.

Step 6: Add ServiceTitan domain to firewall exclusions

If your website uses a domain firewall, add the servicetitan.com domain to the safe exclusions.

Step 7: Check if DNI is working successfully

The DNI test gauges whether your Dynamic Number Insertion (DNI) is installed optimally. It does not directly impact how the feature functions.

In rare cases, the DNI test on the DNI Settings screen may show that the test failed, even if DNI is working on your website. You can most likely disregard the DNI test error if:

  • The website phone number swaps to a ServiceTitan DNI pool number.

  • You can call the DNI pool number and connect successfully.

  • The call appears in ServiceTitan with the correct campaign.

To confirm if DNI is working successfully:

  1. Go to your company website.

  2. Check if your advertised phone number automatically changes to an assigned tracking number from your DNI pool. The advertised number should be the same number set up in your ServiceTitan DNI settings. For example, any number where the Campaign field is set to Allocated to DNI in Settings > Phones > Phone Numbers.

  3. Go to Marketing Pro > Attributed Leads > Inbound Calls to see if inbound calls to DNI pool numbers are appearing.

If your website updates the advertised number to a ServiceTitan tracking number and shows those calls in Attributed Leads, you can ignore the DNI Test failure. For more, see Dynamic Call Tracking using DNI Integration.