Call interval oetags


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function oetag(id) {
  2. jx.load('oetag.php?SID=coreg2-^SID{}&oetagID=' + id, null, 'text', 'post');
  3. }
  4. var callDurationOetag = {
  5. intervals: [
  6. { name: '1_15', min: 1, max: 15 },
  7. { name: '15_30', min: 16, max: 30 },
  8. { name: '30_45', min: 31, max: 45 },
  9. { name: '45_60', min: 46, max: 60 },
  10. { name: '60_90', min: 61, max: 90 },
  11. { name: '90_120', min: 91, max: 120 },
  12. { name: '120_150', min: 121, max: 150 },
  13. { name: '150_180', min: 151, max: 180 },
  14. { name: '180_210', min: 181, max: 210 },
  15. { name: '210_240', min: 211, max: 240 },
  16. { name: '240_270', min: 241, max: 270 },
  17. { name: '270_300', min: 271, max: 300 },
  18. { name: '300_360', min: 301, max: 360 },
  19. { name: '361_420', min: 361, max: 420 },
  20. { name: '421_480', min: 361, max: 480 },
  21. { name: '481_540', min: 481, max: 540 },
  22. { name: '540_600', min: 541, max: 600 },
  23. { name: '600_660', min: 601, max: 660 },
  24. { name: '660_720', min: 661, max: 720 },
  25. { name: '721_780', min: 721, max: 780 },
  26. { name: '781_840', min: 781, max: 840 },
  27. { name: '841_900', min: 841, max: 900 },
  28. { name: '901_960', min: 901, max: 960 },
  29. { name: '961_1020', min: 961, max: 1020 },
  30. { name: '1021_1080', min: 1021, max: 1080 },
  31. { name: '1081_1140', min: 1081, max: 1140 },
  32. { name: '1141_1200', min: 1141, max: 1200 },
  33. { name: '1201_1260', min: 1201, max: 1260 },
  34. { name: '1261_1320', min: 1261, max: 1320 },
  35. { name: '1321_1380', min: 1321, max: 1380 },
  36. { name: '1381_1440', min: 1381, max: 1440 },
  37. { name: '1441_1500', min: 1441, max: 1500 },
  38. { name: '1501_1560', min: 1501, max: 1560 },
  39. { name: '1561_1620', min: 1561, max: 1620 },
  40. { name: '1621_1680', min: 1621, max: 1680 },
  41. { name: '1681_1740', min: 1681, max: 1740 },
  42. { name: '1700plus', min: 1741, max: 9999 }
  43. ],
  44. _getInterval: function (val) {
  45. if (val.match(/\d{1,3}/)) {
  46. for (var i = 0; i < this.intervals.length; i++) {
  47. if ((this.intervals[i].min <= val) && (this.intervals[i].max >= val)) {
  48. return this.intervals[i].name;
  49. }
  50. }
  51. }
  52. return false;
  53. },
  54. send: function (val) {
  55. var interval = this._getInterval(val);
  56. if (interval) {
  57. oetag('ppc_call_duration_' + interval);
  58. }
  59. }
  60. };

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.