Last active
October 25, 2017 10:38
-
-
Save pet-ivanov/c9a10f2ed55abd71a73585ddee7f3dc0 to your computer and use it in GitHub Desktop.
Revisions
-
Vladimir V. Ivanov revised this gist
Oct 25, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function getParameterByName(name, url) { } $(function() { var $ = jQuery = jquery_3_1_0; var THANKS_URL = 'http://thanks.positive.bio/?offer_id=75' // url страницы "спасибо" var TOKEN = 'TOKEN' $('form').submit(function() { -
Vladimir V. Ivanov revised this gist
Oct 25, 2017 . 1 changed file with 11 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,18 @@ <script type="text/javascript" src="https://yastatic.net/jquery/3.1.0/jquery.min.js"></script> <script>var jquery_3_1_0 = jQuery;</script> <script type="text/javascript"> function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } $(function() { var $ = jQuery = jquery_3_1_0; var THANKS_URL = 'thanks.positive.bio/?offer_id=75' // url страницы "спасибо" var TOKEN = 'TOKEN' $('form').submit(function() { @@ -21,13 +23,13 @@ $(function () { token: TOKEN, name: $('[name="name"]', form).val(), phone: $('[name="phone"]', form).val(), aff_sub: getParameterByName('sub1'), aff_sub2: getParameterByName('sub2'), aff_sub3: getParameterByName('sub3'), aff_sub4: getParameterByName('sub4'), aff_sub5: getParameterByName('sub5'), }, success: function(data) { // редиректим на страницу "спасибо" с параметрами конверсии в URL if (data.response.success == 'true') { var conversion = data.response.conversions[0] -
Vladimir V. Ivanov revised this gist
Aug 16, 2017 . No changes.There are no files selected for viewing
-
Vladimir V. Ivanov revised this gist
Aug 16, 2017 . 1 changed file with 43 additions and 43 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,46 +1,46 @@ <script type="text/javascript" src="https://yastatic.net/jquery/3.1.0/jquery.min.js"></script> <script type="text/javascript"> function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } $(function () { var THANKS_URL = 'http://DOMAIN.com/thanks.html?ok=1' // url страницы "спасибо" var TOKEN = 'TOKEN' $('form').submit(function() { var form = $(this) $.post({ url: 'http://leads.api.drcash.me/sf', data: { token: TOKEN, name: $('[name="name"]', form).val(), phone: $('[name="phone"]', form).val(), aff_sub: getParameterByName('sub1'), aff_sub2: getParameterByName('sub2'), aff_sub3: getParameterByName('sub3'), aff_sub4: getParameterByName('sub4'), aff_sub5: getParameterByName('sub5'), }, success: function (data) { // редиректим на страницу "спасибо" с параметрами конверсии в URL if (data.response.success == 'true') { var conversion = data.response.conversions[0] THANKS_URL += (THANKS_URL.indexOf('?') >= 0 ? '&' : '?') + $.param(conversion) // добавляем параметры window.location.replace(THANKS_URL); // редирект } else { console.error('При отправке конверсии произошла ошибка: ' + data.response.msg) } }, dataType: 'json' }) return false }) }) </script> -
Vladimir V. Ivanov renamed this gist
Aug 16, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Vladimir V. Ivanov renamed this gist
Aug 16, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Vladimir V. Ivanov revised this gist
Jun 22, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ return decodeURIComponent(results[2].replace(/\+/g, " ")); } $(function () { var THANKS_URL = 'http://DOMAIN.com/thanks.html?ok=1' // url страницы "спасибо" var TOKEN = 'TOKEN' $('form').submit(function() { -
Vladimir V. Ivanov created this gist
Jun 22, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,46 @@ <script type="text/javascript" src="https://yastatic.net/jquery/3.1.0/jquery.min.js"></script> <script type="text/javascript"> function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, "\\$&"); var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, " ")); } $(function () { var THANKS_URL = 'http://domain.com/thanks.html?ok=1' // url страницы "спасибо" var TOKEN = 'TOKEN' $('form').submit(function() { var form = $(this) $.post({ url: 'http://leads.api.drcash.me/sf', data: { token: TOKEN, name: $('[name="name"]', form).val(), phone: $('[name="phone"]', form).val(), aff_sub: getParameterByName('sub1'), aff_sub2: getParameterByName('sub2'), aff_sub3: getParameterByName('sub3'), aff_sub4: getParameterByName('sub4'), aff_sub5: getParameterByName('sub5'), }, success: function (data) { // редиректим на страницу "спасибо" с параметрами конверсии в URL if (data.response.success == 'true') { var conversion = data.response.conversions[0] THANKS_URL += (THANKS_URL.indexOf('?') >= 0 ? '&' : '?') + $.param(conversion) // добавляем параметры window.location.replace(THANKS_URL); // редирект } else { console.error('При отправке конверсии произошла ошибка: ' + data.response.msg) } }, dataType: 'json' }) return false }) }) </script>