diff --git a/app/views/layouts/_crisp.html.haml b/app/views/layouts/_crisp.html.haml index d16217cd0..4100bd050 100644 --- a/app/views/layouts/_crisp.html.haml +++ b/app/views/layouts/_crisp.html.haml @@ -1,15 +1,14 @@ -- if request.path == root_path - :javascript - window.$crisp=[]; - window.CRISP_WEBSITE_ID="779b5050-4cc1-4172-8dd0-bde55716a289"; - (function(){ - d=document; - s=d.createElement("script"); - s.src="https://client.crisp.im/l.js"; - s.async=1; - d.getElementsByTagName("head")[0].appendChild(s); - })(); - window.$crisp.push(["do", "chat:show"]); -- else - :javascript - window.$crisp && window.$crisp.push(["do", "chat:hide"]); +:javascript + window.$crisp=[]; + window.CRISP_WEBSITE_ID="779b5050-4cc1-4172-8dd0-bde55716a289"; + (function(){ + d=document; + s=d.createElement("script"); + s.src="https://client.crisp.im/l.js"; + s.async=1; + d.getElementsByTagName("head")[0].appendChild(s); + })(); + window.$crisp.push(["do", "chat:hide"]); + window.$crisp.push(["on", "chat:closed", function () { + window.$crisp.push(["do", "chat:hide"]); + }]); diff --git a/app/views/root/landing.html.haml b/app/views/root/landing.html.haml index b57f03c79..c85bf7b80 100644 --- a/app/views/root/landing.html.haml +++ b/app/views/root/landing.html.haml @@ -8,7 +8,7 @@ %br vos procédures administratives en quelques minutes - %a.hero-button{ target: "_blank", onclick: "javascript: ga('send', 'pageview', '/demander-une-demo'); $crisp.push(['do', 'chat:open'])" } Demander une démo + %a.hero-button{ target: "_blank", onclick: "javascript: ga('send', 'pageview', '/demander-une-demo'); $crisp.push(['do', 'chat:show']); $crisp.push(['do', 'chat:open']);" } Demander une démo %p.hero-phone-cta ou nous appeler au 09 72 62 57 12 @@ -128,6 +128,6 @@ %h1.cta-panel-title Commencez à dématerialiser vos procédures %p.cta-panel-explanation Nous vous accompagnons dans la prise en main de l’outil %div - %a.cta-panel-button{ target: "_blank", onclick: "javascript: ga('send', 'pageview', '/demander-une-demo'); $crisp.push(['do', 'chat:open'])" } Demander une démo + %a.cta-panel-button{ target: "_blank", onclick: "javascript: ga('send', 'pageview', '/demander-une-demo'); $crisp.push(['do', 'chat:show']); $crisp.push(['do', 'chat:open']);" } Demander une démo %p.cta-panel-phone-cta ou nous appeler au 09 72 62 57 12