Adding DNI to a Website

1. Retrieving the Marketing Edge JavaScript snippet

In order to have DNI perform number replacement you need to ensure that the Marketing Edge JavaScript snippet is deployed to your website.

When creating your Groups, a JavaScript snippet will be automatically generated.

Example: GET https://edgeapi.marchex.io/marketingedge/v5/api/groups/{group_id}

Response:

{
    "id": 11623346,
    "name": "ABC Company",
    "time_zone_id": "Central",
    "dni_type": "session",
    "billing_group_id": 4455,
    "tracking_javascript": "<script type=\"text/javascript\" src=\"#{dni-api-url}/sdk?identifier=9bc2e20d-dad4-48f7-a630-83622bbfe3bb\" async></script>",
    "status": "active",
    "created_datetime": "2018-05-11T18:19:20.7946016Z",
    "modified_datetime": "2018-05-11T18:19:20.7946016Z"
}

You will need to extract the JavaScript from the tracking_javascript portion of the response, and insert it within the <head> tag of the website where you want number replacement to occur.

2. Installing DNI

The Marketing Edge JavaScript snippet must execute on all pages were you want DNI to occur.

For best results, ensure that the JavaScript snippet is deploy within the <head> tag of your website.

3. Tag Managers

The Marketing Edge JavaScript snippet has been tested to work with Tag Managers. Be aware that number replacement occurs when the Marketing Edge JavaScript loads; any additional load time introduced by the tag manager will result in a corresponding delay in number replacement. As a best practice for Google or Adobe Tag managers, it is recommended to load the Marchex DNI script on DOM ready.