Capturing On Page Variables

Capturing on-page variables

By default, the the DNI JavaScript snippet collects the following data:

• Landing Page URL
• UTM Parameters
• Referrer URL
• User Agent
• IP Address
• Google Analytics cookie values
• Adobe Analytics cookie values

You can also add a JavaScript variable that will be read by the DNI JavaScript snippet. For example, the following JavaScript sample contains a marchex_dni_management JavaScript variable. This variable contains a JSON object named on_page_variables. Within the on_page_variables object, you can specify key/value pairs that will be captured and associated with phone calls or text conversations attributed to a DNI session:

<script type="text/javascript" src="//web-2-tel.com/sdk?identifier=74b9dd6edf58406da043887dcd4b2113" async></script>
<script language="javascript">

var marchex_dni_management = {
    "on_page_variables": {
        "business_number": 12349876,
        "listing_name": "Abc Comapany Inc.",
    }
}
</script>