S
S
Sergey Almazov2018-07-19 18:23:47
1C-Bitrix
Sergey Almazov, 2018-07-19 18:23:47

Connect Tovarro meter?

Hello, I have the following counter code

<!-- Tovarro Sensor -->
<sc ript type="text/javascript">
    (function() {
       var d = document, w = window;
       w.MgSensorData = w.MgSensorData || [];
       w.MgSensorData.push({
           cid:0000,
           lng:"ru",
           nosafari:true,
           eid: {0},
           partner:00000,
           project: "a.tovarro.com",
           goods:[{dont_show_eids}]
       });
       var l = "a.tovarro.com";
       var n = d.getElementsByTagName("script")[0];
       var s = d.createElement("script");
       s.type = "text/javascript";
       s.async = true;
       var dt = !Date.now?new Date().valueOf():Date.now();

, I need to somehow insert it on all pages of the site on Bitrix.
Bitrix kernel version 18, power tools template.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mirexdoors, 2018-07-19
@It-men

Go to the template folder /local/templates/template_name or /bitrix/templates/template_name find the footer.php file there and paste it there. If you want, this is rude and not quite right.
If you want to make it smarter and prettier, look for a folder with scripts (js, assets, etc.) in the above folder, create the tovarro.js file in it. This is where you put your script. Then find the header.php file in the template folder. In it Inside < specify:head>... </head>

use Bitrix\Main\Page\Asset;

Asset::getInstance()->addJs(SITE_TEMPLATE_PATH . "/js/tovarro.js");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question