Интеграция с TravelLine — различия между версиями
Elizabeth (обсуждение | вклад) |
Elizabeth (обсуждение | вклад) |
||
Строка 18: | Строка 18: | ||
'''Если настраивают специалисты Alytics, то последовательность такая:''' | '''Если настраивают специалисты Alytics, то последовательность такая:''' | ||
− | 2.1. Чтобы виджет бронирования TravelLine отдавал google client id наружу необходимо обновить код виджета бронирования TravelLine | + | 2.1. Чтобы виджет бронирования TravelLine отдавал google client id "наружу" необходимо обновить код виджета бронирования TravelLine, который обычно выглядит так: |
+ | |||
+ | <pre> | ||
+ | <!-- start TL Booking form script --> | ||
+ | <div id="tl-booking-form"> </div> | ||
+ | <script type="text/javascript">// <![CDATA[ | ||
+ | (function (w) { | ||
+ | var q = [ | ||
+ | ['setContext', 'TL-INT-seagalaxy-new', 'ru'], | ||
+ | ['embed', 'booking-form', { | ||
+ | container: 'tl-booking-form', | ||
+ | onConnect: function connect(app) { | ||
+ | ga && ga(function (gaTracker) { | ||
+ | app.pushArtifact('GaClientId', gaTracker.get('clientId')); | ||
+ | }); | ||
+ | }, | ||
+ | }] | ||
+ | ]; | ||
+ | var t = w.travelline = (w.travelline || {}), ti = t.integration = (t.integration || {}); | ||
+ | ti.__cq = ti.__cq ? ti.__cq.concat(q) : q; | ||
+ | if (!ti.__loader) { | ||
+ | ti.__loader = true; | ||
+ | var d = w.document, p = d.location.protocol, s = d.createElement('script'); | ||
+ | s.type = 'text/javascript'; | ||
+ | s.async = true; | ||
+ | s.src = (p == 'https:' ? p : 'http:') + '//ibe.tlintegration.com/integration/loader.js'; | ||
+ | (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); | ||
+ | } | ||
+ | })(window); | ||
+ | // ]]></script> | ||
+ | <!-- end TL Booking form script --> | ||
+ | </pre> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | В него добавить следующий строчки: | ||
+ | |||
+ | <pre> | ||
+ | var bookingSuccess = function (data) { | ||
+ | if (typeof alsTracker !== 'undefined' && alsTracker) { | ||
+ | alsTracker.setGoogleClientId(); | ||
+ | alsTracker.handleRequestData('', { | ||
+ | phone: data.customerPhone, | ||
+ | email: data.customerEmail | ||
+ | }, 'ajax'); | ||
+ | } | ||
+ | }; | ||
+ | |||
+ | </pre> | ||
+ | |||
+ | и | ||
+ | |||
+ | <pre> | ||
+ | onBookingSuccess: bookingSuccess | ||
+ | </pre> | ||
+ | |||
+ | <br> | ||
+ | |||
+ | Итоговый код должен получиться таким: | ||
<pre> | <pre> | ||
Строка 43: | Строка 101: | ||
}); | }); | ||
}, | }, | ||
− | + | onBookingSuccess: bookingSuccess | |
}] | }] | ||
]; | ]; |
Версия 11:56, 29 июля 2021
TravelLine (https://www.travelline.ru/) — это модуль онлайн-бронирования для отелей, гостиниц и пансионатов. Если у вас на сайте стоит модуль бронирования TravelLine, то для внедрения сквозной аналитики вам нужно:
1. Связать TravelLine c вашей CRM
У вас должна быть CRM-система, например, Битрикс24 или amoCRM. Вам необходимо в TravelLine настроить связку с CRM-системой, чтобы в CRM создавались Сделки или Лиды с модуля бронирования. Подробнее о том, как связать TravelLine с CRM, в базе знаний TravelLine: https://www.travelline.ru/support/knowledge-base/kak-nachat-rabotu-v-lichnom-kabinete-travelline/.
2. Настройте передачу google client id из TravelLine в CRM
Вы можете сделать передачу google client id из TravelLine в CRM самостоятельно. Что такое google client id и где его взять описано здесь https://wiki.alytics.ru/index.php?title=Как_подготовить_CRM_для_подключения_к_Alytics, либо специалисты Alytics настоят такую интеграцию при оплате сервиса Alytics на пол года и больше.
Если настраивают специалисты Alytics, то последовательность такая:
2.1. Чтобы виджет бронирования TravelLine отдавал google client id "наружу" необходимо обновить код виджета бронирования TravelLine, который обычно выглядит так:
<!-- start TL Booking form script --> <div id="tl-booking-form"> </div> <script type="text/javascript">// <![CDATA[ (function (w) { var q = [ ['setContext', 'TL-INT-seagalaxy-new', 'ru'], ['embed', 'booking-form', { container: 'tl-booking-form', onConnect: function connect(app) { ga && ga(function (gaTracker) { app.pushArtifact('GaClientId', gaTracker.get('clientId')); }); }, }] ]; var t = w.travelline = (w.travelline || {}), ti = t.integration = (t.integration || {}); ti.__cq = ti.__cq ? ti.__cq.concat(q) : q; if (!ti.__loader) { ti.__loader = true; var d = w.document, p = d.location.protocol, s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = (p == 'https:' ? p : 'http:') + '//ibe.tlintegration.com/integration/loader.js'; (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); } })(window); // ]]></script> <!-- end TL Booking form script -->
В него добавить следующий строчки:
var bookingSuccess = function (data) { if (typeof alsTracker !== 'undefined' && alsTracker) { alsTracker.setGoogleClientId(); alsTracker.handleRequestData('', { phone: data.customerPhone, email: data.customerEmail }, 'ajax'); } };
и
onBookingSuccess: bookingSuccess
Итоговый код должен получиться таким:
<!-- start TL Booking form script --> <div id="tl-booking-form"> </div> <script type="text/javascript">// <![CDATA[ (function (w) { var bookingSuccess = function (data) { if (typeof alsTracker !== 'undefined' && alsTracker) { alsTracker.setGoogleClientId(); alsTracker.handleRequestData('', { phone: data.customerPhone, email: data.customerEmail }, 'ajax'); } }; var q = [ ['setContext', 'TL-INT-seagalaxy-new', 'ru'], ['embed', 'booking-form', { container: 'tl-booking-form', onConnect: function connect(app) { ga && ga(function (gaTracker) { app.pushArtifact('GaClientId', gaTracker.get('clientId')); }); }, onBookingSuccess: bookingSuccess }] ]; var t = w.travelline = (w.travelline || {}), ti = t.integration = (t.integration || {}); ti.__cq = ti.__cq ? ti.__cq.concat(q) : q; if (!ti.__loader) { ti.__loader = true; var d = w.document, p = d.location.protocol, s = d.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = (p == 'https:' ? p : 'http:') + '//ibe.tlintegration.com/integration/loader.js'; (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s); } })(window); // ]]></script> <!-- end TL Booking form script -->
2.2. В TravelLine нужно включить отправку события "onBookingSuccess". Для этого можно обратиться к поддержке TravelLine.
2.3. Теперь google client id будет передавать "наружу" и его сможет подхватить трекер-cid (захватчик форм), который настраивают специалисты по интеграции Alytics.