From 0bbe60633d32789ef31e1608c83b8ec443446417 Mon Sep 17 00:00:00 2001 From: Amauri CHAMPEAUX Date: Wed, 26 Sep 2018 12:07:02 +0200 Subject: [PATCH] Add Tawk.to --- tarteaucitron.services.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tarteaucitron.services.js b/tarteaucitron.services.js index 52cacd6..1d8bd78 100644 --- a/tarteaucitron.services.js +++ b/tarteaucitron.services.js @@ -2412,3 +2412,24 @@ tarteaucitron.services.activecampaign = { tarteaucitron.addScript('https://trackcmp.net/visit?actid='+tarteaucitron.user.actid+'&e='+encodeURIComponent(trackcmp_email)+'&r='+encodeURIComponent(document.referrer)+'&u='+encodeURIComponent(window.location.href)); } }; + +// tawk.to +tarteaucitron.services.tawkto = { + "key": "tawkto", + "type": "support", + "name": "Tawk.to chat", + "uri": "https://www.tawk.to/data-protection/", + "needConsent": true, + "cookies": [], + "js": function () { + "use strict"; + if (tarteaucitron.user.tawktoId === undefined) { + return; + } + + window.Tawk_API=window.Tawk_API||{}; + window.Tawk_LoadStart=new Date(); + + tarteaucitron.addScript('https://embed.tawk.to/' + tarteaucitron.user.tawktoId + '/default'); + } +};