Answer the question
In order to leave comments, you need to log in
How to make sending data work?
Hello. All with the upcoming!
Please help. For solving the problem with me for a beer is guaranteed!
You need to force the script to collect data and send it to CRM.
There is documentation - https://help.retailcrm.ru/Developers/Collector#examples
I need to attach a handler to my landing page so that the data is sent when the order is placed.
From the documentation I understand that you need to connect:
<script type="text/javascript">
(function(_,r,e,t,a,i,l){_['retailCRMObject']=a;_[a]=_[a]||function(){(_[a].q=_[a].q||[]).push(arguments)};_[a].l=1*new Date();l=r.getElementsByTagName(e)[0];i=r.createElement(e);i.async=!0;i.src=t;l.parentNode.insertBefore(i,l)})(window,document,'script','https://collector.retailcrm.pro/w.js','_rc');
_rc('create', 'RC-16632969589'); // это ключ от CRM аккаунта
_rc('send', 'pageView');
</script>
<script type="text/javascript">
$(function() {
$('#feedback-form').submit(function() {
_rc('send', 'order', {
'name': $(this).find('input[name=name]').val(),
'email': $(this).find('input[name=email]').val(),
});
return false;
})
})
</script>
<form class="form-element" action="/mod/lead/send/" method="post" enctype="multipart/form-data" novalidate=""
<input type="text" class="form-field-text--input" name="form[273045]" autocomplete="on" data-check="name" data-required="true" required="">
<input type="tel" class="form-field-text--input" name="form[666702]" autocomplete="on" data-check="phone" data-mask="phone" data-required="true" required="">
$('#form-element').submit(function() {
_rc('send', 'order', {
'name': $(this).find('input[form[273045]]').val(),
'email': $(this).find('input[form[666702]]').val(),
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question