Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. <!––
  2.  
  3. OfflineKPI.com V1.0 CODE START
  4.  
  5. 1. Google analytics tracking script must be on page
  6. 2. If you already use jQuery, remove our
  7. 3. If you already use sweet alert, remove ours
  8.  
  9. ––>
  10.  
  11. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  12. <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert-dev.min.js"></script>
  13. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css" />
  14.  
  15. <script type="text/javascript" src="https://offlinekpi.com/js/offlinekpi.js">
  16.  
  17. <script>
  18. $(document).ready(function(e){
  19. $( "#target" ).submit(function( event ) {
  20. //var api_key = $("#api_key").val();
  21. //var form_id = $("#form_id").val();
  22. //var account_id = $("#account_id").val();
  23. var ga_clientId = $("#ga_clientId").val();
  24.  
  25.  
  26. $.ajax({
  27. crossDomain: true,
  28. url: "http://offlinekpi.com/callback/lead_import.php?action=import_lead&",
  29. type: "GET",
  30. data: {
  31.  
  32. api_key: 'wsder-51588-aswed',
  33. form_id: 5,
  34. account_id: 1,
  35. ga_clientId: ga_clientId,
  36. lead_type_id:
  37. },
  38. dataType: "jsonp",
  39. jsonpCallback: 'callback',
  40. contentType: "application/json",
  41. crossDomain: true,
  42. success: function(data) {
  43. if (data.success == 1){
  44. swal("Thanks", "We Will contact you Soon", "success");
  45. $("#target").hide();
  46. }
  47. },
  48. error: function(data){
  49. console.log("error", data);
  50. }
  51. });
  52. event.preventDefault();
  53. });
  54. });
  55. </script>
  56. <form id="target">
  57. <input type="hidden" id="ga_clientId" value="">
  58. <table>
  59.  
  60. <tr>
  61. <td colspan="2" align="right"> <input type="submit" value="Save" > </td>
  62. </tr>
  63. </table>
  64. </form>
  65.  
  66. <!–– OfflineKPI.com V1.0 CODE END -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement