Skip to content

Instantly share code, notes, and snippets.

@nikunjkotecha
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save nikunjkotecha/8139eec89219b98ce897 to your computer and use it in GitHub Desktop.

Select an option

Save nikunjkotecha/8139eec89219b98ce897 to your computer and use it in GitHub Desktop.
adRinger JS Code Format
<!-- adRinger JS library -->
<script type="text/javascript" src="http://<<advertiser_code>>.callsrv.in/callsrv.js?ver=1.0"></script>
<script type="text/javascript">
/* JSON object to define Parameters for reporting */
var params= {'customparam1' : 'customvalue1', 'customparam2' : 'customvalue2'};
var settings = {
"params" : params, // Optional, Custom parameters(in JSON format), Type : String, Default : null
"replace" : "my-id", // Optional, ID of HTML element to replace Number in that element once number is assigned, Type : String, Default : null
"callback" : "callback", // Optional, Custom Callback function, Type : String, Default : null
"autodial" : true // Optional, False if you want to disable autodial, Type : String, Default : true
};
/* Call adRingerGetNumber function to initiate the process. */
adRingerGetNumber(<<campaign_id>>, settings);
/* Advertiser's function to handle number. */
function callback(data) {
/*
Add your code here
data.formatted -> This will give you number in +1-xxx-xxx-xxxx format
data.number -> This will give you number in +1xxxxxxxxxx format
*/
alert(data.formatted);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment