The following parameters can be sent in the data object. One or more parameters must be sent

ParameterDescriptionDefault ValueData TypeMandatory
nSpecifies the Node ID STRINGNO
nnSpecifies the Node Name STRINGNO
ntSpecifies the Node Type STRINGNO
lSpecifies the Link ID STRINGNO
lnSpecifies the Link Name STRINGNO
ltSpecifies the Link Type STRINGNO

Example Javascript

  • This is searching for Node ID "myTestNodeId" and uses the __gaKeywd to match Google keyword against a Link ID
  • It will show the fallback number/text if no match is found and will populate the HTML element with ID "phonenumber". See our General Parameters  page for more information on VoxReq.resp
  • For the search you can use any of the following Magic Functions.
<script type="text/javascript">
   var VoxReq = {}; // Initialise empty request object
   VoxReq.auth = {"accK":"fe803fbc4629d15aae13ab9fe8c1e187d8c62de9","actK":"fe8c1e187d8c62de9ge803fbc4629d15aae13ab9"}; // Authentication data
   VoxReq.data = {"n":"myTestNodeId","ln":"gaKeywd"}; // Data parameters from the table above. gaKeywd is a magic function
   VoxReq.resp = {"fallback":"+44FallbackNumber","elementsBy":{"match":"id","element":"phonenumber"}}; // Response data

   (function() {
     var vox = document.createElement('script'); vox.type = 'text/javascript';
     vox.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'www.voxanalytics.com/js/api/vox.js';
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vox, s);
   })();
 </script>

Result

Success Result

 document.getElementById('phonenumber').innerHTML = '+442071234567'

Failure Result - i.e. no result matching your search criteria

 document.getElementById('phonenumber').innerHTML = '+44FallbackNumber';