/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function oetag(id) { jx.load('oetag.php?SID=coreg2-^SID{}&oetagID=' + id, null, 'text', 'post'); } var callDurationOetag = { intervals: [ { name: '1_15', min: 1, max: 15 }, { name: '15_30', min: 16, max: 30 }, { name: '30_45', min: 31, max: 45 }, { name: '45_60', min: 46, max: 60 }, { name: '60_90', min: 61, max: 90 }, { name: '90_120', min: 91, max: 120 }, { name: '120_150', min: 121, max: 150 }, { name: '150_180', min: 151, max: 180 }, { name: '180_210', min: 181, max: 210 }, { name: '210_240', min: 211, max: 240 }, { name: '240_270', min: 241, max: 270 }, { name: '270_300', min: 271, max: 300 }, { name: '300_360', min: 301, max: 360 }, { name: '361_420', min: 361, max: 420 }, { name: '421_480', min: 361, max: 480 }, { name: '481_540', min: 481, max: 540 }, { name: '540_600', min: 541, max: 600 }, { name: '600_660', min: 601, max: 660 }, { name: '660_720', min: 661, max: 720 }, { name: '721_780', min: 721, max: 780 }, { name: '781_840', min: 781, max: 840 }, { name: '841_900', min: 841, max: 900 }, { name: '901_960', min: 901, max: 960 }, { name: '961_1020', min: 961, max: 1020 }, { name: '1021_1080', min: 1021, max: 1080 }, { name: '1081_1140', min: 1081, max: 1140 }, { name: '1141_1200', min: 1141, max: 1200 }, { name: '1201_1260', min: 1201, max: 1260 }, { name: '1261_1320', min: 1261, max: 1320 }, { name: '1321_1380', min: 1321, max: 1380 }, { name: '1381_1440', min: 1381, max: 1440 }, { name: '1441_1500', min: 1441, max: 1500 }, { name: '1501_1560', min: 1501, max: 1560 }, { name: '1561_1620', min: 1561, max: 1620 }, { name: '1621_1680', min: 1621, max: 1680 }, { name: '1681_1740', min: 1681, max: 1740 }, { name: '1700plus', min: 1741, max: 9999 } ], _getInterval: function (val) { if (val.match(/\d{1,3}/)) { for (var i = 0; i < this.intervals.length; i++) { if ((this.intervals[i].min <= val) && (this.intervals[i].max >= val)) { return this.intervals[i].name; } } } return false; }, send: function (val) { var interval = this._getInterval(val); if (interval) { oetag('ppc_call_duration_' + interval); } } };