Skip to content

DNI Extension

The dni extension allows you to dynamically insert call-tracking phone numbers on your website. This also detects and maintains the format and/or pattern of the phone number on the site (perenthencies, dashes, spaces, etc.).

Installation

This extension can be enabled through Orbee's Platform. If you are manually controlling installation and setup, you can also fetch the plugin here:

<script async src="https://scripts.orb.ee/js-sdk/latest/dni.js" />

This standalone installation sets up the extension's class on the window object, under window.OaDniExtension. You can then extend your scope like this:

oa.getScope(YOUR_SCOPE).extend('dni', OaDniExtension);

Configuration

This extension requires only one configuration parameter:

numbers

Numbers is an array of objects in the format: find/insert, like this:

config.numbers = [
    [ 'SOURCE', 'MEDIUM', 'NUMBER_TO_FIND', 'NUMBER_TO_INSERT' ]
];

It will only find/insert if the source/medium matches the current visit. The logic for this is not super-robust, but includes google/facebook traffic, organic search traffic, referral traffic, and direct-to-site traffic -- on top of the standard UTM parameters.

Methods

This extension has a variety of available attributes and functions to call.

dni.possibleAlterations

This parameter keeps track of the numbers that passed the source/medium check and are actively trying to be inserted on the site. It keeps track of only the number to find and the number to insert.

dni.alterations

This parameter keeps track of what alterations are made for each number we want to find. Since a number can show up multiple times on a web page, each number has a list of objects that keep track of alterations.

These objects keep track of the element, type, and inserted number for each number that is altered.

dni.getAllElementsDetected()

This method returns a list of links (<a hre='tel:...'>) and text nodes that contain phone numbers on the web page.

Events

The extension generates no events.

Listening

This extension does not listen for any events in the SDK.

Dependencies

This extension does not depend on any other extensions.