Your browser does not support JavaScript!

Set Up Instructions: Dynamic Number Insertion (DNI)

For originating ad source attribution, follow these Dynamic Number Insertion (DNI) instructions on your property websites.

Last Update:
February 26, 2020
Call Tracking


These instructions provide an overview of how to implement Dynamic Number Insertion (DNI) on a website. The LeaseHawk DNI interface is encapsulated in a javascript file that calls a service on LeaseHawk’s servers. The javascript file will return an unformatted number in string format to be used in the website. Implementing this javascript in a web page is relatively straight forward. The process is:

  1. Reference the lookup.js javascript file in your web page
  1. Insert the javascript call to return the DNI number
  1. Insert AdSource information into your ad source

Updating Previous DNI Code on Your Website

If you have previously implemented DNI code on your website, then you will need to change the script source URL to use the updated code.

Implementing DNI Code on Your Website

Reference the lookup.js javascript file in your web page

The DNI interface is exposed as a function in a javascript file. So the first step is to include that file in your web page. In the head of your web page, include a reference to the lookup.js file that resides on the LeaseHawk servers like so:

Insert the javascript call to render the DNI number

The interface call has one required parameter - siteId. The site identifier can be found in the spreadsheet provided by the LeaseHawk Customer Service team.

The call itself can be anywhere on your page where javascript is executed. Displaying of the number returned from the API is left up to the web developer. The call to retrieve the number is done like so:

You will need to repeat the lookup.getNumber() javascript function for each site on your page that you would like DNI to work with.

Secure Content

Some customers will want to display numbers on a secure page. The standard implementation will cause security warnings to be displayed on a secure web page. In order to address this, a secure version of the DNI javascript file has been created. To use the secure file, change this:


In some cases, it is desirable to take action when a resource takes a long time to load. For sites that have strict performance requirements, this can be a serious concern. The LeaseHawk DNI API allows specification of a timeout in milliseconds. If the timeout is exceeded, then an error will be raised and the user provided error method will be called. Here is an example of what a request with the timeout:

Example Code:

Updating Your Ad Source with the LHAdSourceID

To activate the code on your website page, you will need to include the LHAdSourceId in the link from your ad source (Google,, etc.) to your website. The identifier associated with each ad source will be provided to you by the LeaseHawk implementation team in an Excel Spreadsheet. So, based on the spreadsheet, you would need to change the ad source link like this:

Becomes...<ad source Id>

Or, if you are using another tracking service (like Google) then you would need to change the ad source link like this:

&LHAdSourceId=<ad source Id>