// 1. Create the container var qc_container = document.createElement( 'div' ); qc_container.id = 'qc-container'; document.body.appendChild( qc_container ); var widget_script = ''; var origin_url = window.document.location.origin; // 2. Create a iframe to load the react App var qc_iframe = document.createElement( 'iframe' ); qc_iframe.id = 'qc-frame'; // position: fixed; remove a white space which was added at the bottom of the page qc_iframe.style.position = 'fixed'; // Cannot use display: none; otherwise the autogrow textarea will not work qc_iframe.style.visibility = 'hidden'; document.body.appendChild( qc_iframe ); qc_iframe.contentWindow.document.write( '' + widget_script + '' ); qc_iframe.contentWindow.document.close(); qc_iframe.contentWindow.context = { baseUrl: 'https://onelocal.com', environment: 'production', merchantId: '6307a319e571df1c8b3e912b', merchantName: 'OneLocal Demo Chiro Physio', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"auto_response":{"enabled":true,"text":"Thanks for texting OneLocal Demo Chiro Physio. We're busy serving other clients right now, but will get back to you as soon as we can.\n\nIn the meantime, you can reply \"APPT\" to book an appointment, \"QUOTE\" to get a quote, or \"INFO\" for our hours and location. Otherwise, we'll get back to you as soon as we can - thank you!"},"call_phone_number":{"national_format":"(289) 778-5473","value":"+12897785473"},"confirmation":{"text":"Your message in now in the OneLocal dashboard and you should have received a text.","title":"Thanks for testing out the LocalMessages widget!"},"intro":{"enabled":true,"text":"Engage with site visitors and have instant lead collection and faster response times."},"message_form":{"name_optional":false,"text":"This is your site widget where customers can contact you if they prefer SMS.","title":"Connect with Site Visitors","cta_text":"Try it out"},"mobile":{"call_cta_enabled":true,"text":"You can text to try LocalMessages or call us to use LocalResponse, it up to you.","title":"Keep in touch with the mobile widget!"},"style":{"primary_color":"#b7d251"},"default_assignee":{"id":"636e5c835c1a1e61aaf9050f","ref":"employees"},"chatbot":{"auto_load":true,"enabled":false,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"phone_number":{"national_format":"(844) 542-0577","value":"+18445420577"},"locations":[],"location_selection":{"title":"Location Selection","text":"Select the location which you would like to contact","skip_text":"Skip"}} }; window.addEventListener( "message", ( event ) => { if( event.origin.indexOf( origin_url ) === -1 || ! event.data?.event_name ) { return; } if( typeof gtag !== "undefined" ) { gtag( "event", event.data.event_name, { name: event.data.event_name } ); } }, false );