D
D
Denis99992021-09-08 14:46:31
1C-Bitrix
Denis9999, 2021-09-08 14:46:31

Bitrix24 forms disappear when integrating with roistat?

It is necessary to make sure that when sending the standard bitrix24 form, visitorID is sent - the roistat visitor code. The problem is that the 1st form works as it should, I do the same by analogy, and the first form disappears .. When I did all 4, I noticed that the previous 3 were gone. I removed the code of the last 3, and the first one appeared .. Some kind of magic ..

The code is this:

<script data-b24-form="inline/13/ntyufw" data-skip-moving="true">
      window.roistatVisitCallback = function (visitId) {
        window.addEventListener('b24:form:init', (event) => {
          let form = event.detail.object;
          form.setProperty("roistatID", visitId);
        });
        (function(w,d,u){
          var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);
          var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
        })(window,document,'https://cdn-ru.bitrix24.ru/b16591156/crm/form/loader_13.js');

      };
    </script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Myznikov, 2021-10-23
@Reikon

You can try to make several separate inline forms with different id, say 13 and 21. It will be enough to bind the roystat once. You will get something like:

<!doctype html>
<html>
    <head>
        <script>
            window.roistatVisitCallback = function (visitId) {
                window.addEventListener('b24:form:init', (event) => {
                    let form = event.detail.object;
                    form.setProperty("roistatID", visitId);
                });
            };
        </script>
    </head>
    <body>
        <script data-b24-form="inline/13/ntyufw" data-skip-moving="true">
            (function(w,d,u){
                var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);
                var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
            })(window,document,'https://cdn-ru.bitrix24.ru/b16591156/crm/form/loader_13.js');
        </script>
        <script data-b24-form="inline/21/abcdef" data-skip-moving="true">
            (function(w,d,u){
                var s=d.createElement('script');s.async=true;s.src=u+'?'+(Date.now()/180000|0);
                var h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
            })(window,document,'https://cdn-ru.bitrix24.ru/b16591156/crm/form/loader_21.js');
        </script>
    </body>
</html>

In this case, the forms should work quietly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question