//if(document.querySelector('[data-script="autoOptimizescript"]')==null) { var optimizeUrl = new URL(window.location.href); var optimizeMode = (optimizeUrl.searchParams.get("ao_mode")!=null) ? optimizeUrl.searchParams.get("ao_mode") : ''; var project_id = (optimizeUrl.searchParams.get("ao_realProjectId")!=null) ? optimizeUrl.searchParams.get("ao_realProjectId") : 0; var $_COOKIE = document.cookie; var $_RELOAD_COOKIE = false; var optimizeScripturl = new URL(document.currentScript.src); var OPTIMIZE_API_URL = "https://app.autooptimize.ai"; console.log("DEBUG API URL", optimizeScripturl); console.log("OPTIMIZE_API_URL", OPTIMIZE_API_URL); var ELEMENT_AO_ID_VS_HASH_MAPPING={}; if(document.currentScript.getAttribute('data-launch') != undefined){ optimizeMode="edit"; } //add referr policy in new chrome referr policy is changed and made it strict which doesnot give us full full path of url var link2 = document.createElement('meta'); link2.setAttribute('name', 'referrer'); link2.content = 'no-referrer-when-downgrade'; document.getElementsByTagName('head')[0].appendChild(link2); if(optimizeMode=="edit"){ if(project_id != 0){ callAPIOld(OPTIMIZE_API_URL+'/api/projects/get-intercom-details/'+project_id); (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/xc39jsxs';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); } else { callAPI(OPTIMIZE_API_URL+'/projects/get-intercom-details'); (function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/xc39jsxs';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})(); } optimizeScripturl="https://cdn.autooptimize.ai/js/ExperimentPreview.js"; } else { var USERDATA = "{\"projects\":{\"eyJpdiI6IkI2TzIvTllKVGRvMUszYW5YNGt4bXc9PSIsInZhbHVlIjoic0pBNU02SzhnUFJ2RVZmbFRyS25LUT09IiwibWFjIjoiZWUxODEzOTFkNmUzOTE5NThkNjM4NjliMzEzNWE3OTRhYzZlYzg1ZDY5MGY3N2EyNWMxOWYwZDdhZjgyMmFkYyIsInRhZyI6IiJ9\":{\"url\":\"https:\\/\\/get.bambucleaning.co.uk\\/getfreequote\\/\",\"projectId\":\"eyJpdiI6IkI2TzIvTllKVGRvMUszYW5YNGt4bXc9PSIsInZhbHVlIjoic0pBNU02SzhnUFJ2RVZmbFRyS25LUT09IiwibWFjIjoiZWUxODEzOTFkNmUzOTE5NThkNjM4NjliMzEzNWE3OTRhYzZlYzg1ZDY5MGY3N2EyNWMxOWYwZDdhZjgyMmFkYyIsInRhZyI6IiJ9\",\"intercomData\":{\"hasIntercom\":true,\"app_id\":\"xc39jsxs\",\"name\":\"Michelle\",\"email\":\"michelle@getyourmarketing.co.uk\",\"created_at\":1594749827,\"show_tour\":1},\"watermark\":0,\"base_url\":\"https:\\/\\/app.autooptimize.ai\",\"experimentData\":{\"project\":{\"id\":22167,\"project_master_id\":null,\"user_id\":1071,\"name\":\"Bambu Funnel\",\"url\":\"https:\\/\\/get.bambucleaning.co.uk\\/getfreequote\\/\",\"success_url\":null,\"success_url_type\":null,\"traffic_percent\":50,\"success_percent\":90,\"improvement\":null,\"page_type\":1,\"custom_page_type\":null,\"product_type\":1,\"custom_product_type\":null,\"industry\":null,\"language\":40,\"screenshot_url\":null,\"status\":4,\"funnel_id\":null,\"created_at\":\"2020-07-14T18:36:51.000000Z\",\"updated_at\":\"2023-10-03T04:37:29.000000Z\",\"deleted_at\":null,\"step_id\":null,\"page_original_id\":null,\"page_variation_id\":null,\"code_added_flag\":1,\"meta_tag_content\":null,\"email_subscription\":\"true\",\"last_cron_run_time\":\"2023-10-03 04:37:28\",\"new_project\":\"1\",\"experiment_data\":null,\"new_experiments\":\"\",\"setup_flag\":0,\"pause_flag\":0,\"last_stats_run_time\":null,\"minimum_visitor\":100,\"project_created\":1,\"project_experiments\":[],\"user\":{\"id\":1071,\"encrypted_id\":\"eyJpdiI6InJZTkF3dTlmUVlCWkdpTFNmZXBTU0E9PSIsInZhbHVlIjoiblQxVk42YjdJZVByN2haVUdZK3ZqQT09IiwibWFjIjoiZTI1M2NjZTJiODhiMzY5YWYwNmMzMWRjOTVmOWQxYWYzN2VkMzA4MjQwOGU3ZGVmZDUwODIxYzk1Y2MyYWUzOCJ9\",\"email\":\"michelle@getyourmarketing.co.uk\",\"phone\":null,\"job_title\":1,\"other_job_title\":null,\"type\":1,\"username\":\"Michelle\",\"first_name\":null,\"last_name\":null,\"profile_pic\":null,\"status_button\":\"hidden\",\"watermark\":0,\"show_tour\":1,\"tour_data\":\"{\\\"a\\\":\\\"true\\\",\\\"b\\\":\\\"true\\\",\\\"c\\\":\\\"false\\\",\\\"d\\\":\\\"false\\\",\\\"e\\\":\\\"false\\\",\\\"f\\\":\\\"false\\\",\\\"g\\\":\\\"false\\\"}\",\"sign_up_free\":0,\"is_agency\":0,\"free_trial_expired\":0,\"daily_traffic_count\":null,\"user_timezone\":\"Europe\\/London\",\"coupon_code\":null,\"plan_status\":null,\"active_status\":0,\"beta_user\":0,\"owner_id\":null,\"recurly_uuid\":null,\"recurly_account\":null,\"current_plan\":null,\"minimum_visitor\":100,\"mail_90_visit\":null,\"mail_visit_reached\":0,\"activation_token\":\"w8amt85nMnxsb2N4foPlZpSiycX1gRj0g7LCmbCkqb2DvC71yp5CPWzDBoL4\",\"passwordResetToken\":null,\"free_plan_started\":null,\"subscription_expire\":null,\"subscription_cancel\":null,\"stripe_id\":null,\"card_last_four\":null,\"stripe_access_token\":null,\"stripe_user_id\":null,\"stripe_refresh_token\":null,\"login_token\":null,\"notification_seen_at\":null,\"watched_video_flag\":0,\"created_at\":\"2020-07-14T18:03:47.000000Z\",\"updated_at\":\"2020-07-14T18:36:52.000000Z\",\"deleted_at\":null,\"isExpired\":true,\"remainingVisitor\":0}},\"url\":\"https:\\/\\/get.bambucleaning.co.uk\\/getfreequote\\/\",\"elementsTypes\":[{\"id\":20,\"name\":\"Headline\",\"slug\":\"headline\",\"selector\":null,\"new_element\":1,\"created_at\":\"2019-03-26T20:52:05.000000Z\",\"updated_at\":\"2019-03-26T20:52:05.000000Z\",\"description\":\"The headline on the page explaining the main offer. Usually just one.\",\"order_experiment\":20,\"platform_experiment\":[{\"id\":2,\"element_type_id\":20,\"experiment_no\":2,\"title\":\"Different headline\",\"description\":\"Different headline\",\"impact\":\"normal\",\"question\":\"Please enter different headline options.\"}]},{\"id\":21,\"name\":\"Subheadline\",\"slug\":\"sub_headline\",\"selector\":null,\"new_element\":1,\"created_at\":\"2019-03-26T20:52:05.000000Z\",\"updated_at\":\"2019-03-26T20:52:05.000000Z\",\"description\":\"The subheadline on the page explaining the headline better. Usually just one.\",\"order_experiment\":40,\"platform_experiment\":[{\"id\":3,\"element_type_id\":21,\"experiment_no\":null,\"title\":\"Red sub headline\",\"description\":\"Red sub headline\",\"impact\":\"normal\",\"question\":\"Please enter different sub headline options.\"}]},{\"id\":22,\"name\":\"Logo\",\"slug\":\"logo\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"This is your logo image\",\"order_experiment\":60,\"platform_experiment\":[]},{\"id\":23,\"name\":\"Sales\\/Demo Video\",\"slug\":\"sales_video\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"This is the main sales or demo video on the page explaining your offer\\/business. Usually just one.\",\"order_experiment\":80,\"platform_experiment\":[{\"id\":1,\"element_type_id\":23,\"experiment_no\":51,\"title\":\"Hide everything until visitors watch at least half the video\",\"description\":\"Hide everything until visitors watch at least half the video\",\"impact\":\"normal\",\"question\":\"Please enter video url\"}]},{\"id\":24,\"name\":\"Signup button\",\"slug\":\"signup_button\",\"selector\":null,\"new_element\":1,\"created_at\":\"2020-05-31T00:00:00.000000Z\",\"updated_at\":null,\"description\":\"A signup button that signs people up to something for free. It can be a free trial, or a newsletter, or anything, so long as it's free. This is different from an Add-To-Cart button or an Order button. \",\"order_experiment\":100,\"platform_experiment\":[]},{\"id\":25,\"name\":\"Add-To-Cart button\",\"slug\":\"add_to_cart_button\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"A button that adds an item to a shopping cart. Different from a Signup button or an Order button.\",\"order_experiment\":120,\"platform_experiment\":[]},{\"id\":26,\"name\":\"Order button\",\"slug\":\"order_buttton\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"A button that finalizes an order or a button that starts the order process for something where the user has to pay. \",\"order_experiment\":140,\"platform_experiment\":[]},{\"id\":28,\"name\":\"Navigation bar\",\"slug\":\"navigation_bar\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"This is your navigation bar with links to various pages on your website. Select the entire navigation bar with all the links inside it. Try not to select other things like logos or call-to-action buttons that may also be found in your header, just the navigation bar.\",\"order_experiment\":180,\"platform_experiment\":[]},{\"id\":29,\"name\":\"Price label\",\"slug\":\"price_label\",\"selector\":null,\"new_element\":1,\"created_at\":\"2020-11-30T11:28:36.000000Z\",\"updated_at\":\"2020-11-30T11:28:36.000000Z\",\"description\":\"A label containing your price. Ideally this should only mention your price and nothing else. If it does mention other text though, that's ok.\",\"order_experiment\":200,\"platform_experiment\":[]},{\"id\":30,\"name\":\"Other important text\",\"slug\":\"other_important_text\",\"selector\":null,\"new_element\":1,\"created_at\":null,\"updated_at\":null,\"description\":\"Any other important text on your page that you'd like to optimize, not just the headline or subheadline or button text.\",\"order_experiment\":43,\"platform_experiment\":[]},{\"id\":31,\"name\":\"Important images\",\"slug\":\"important_images\",\"selector\":null,\"new_element\":1,\"created_at\":\"2021-03-17T11:07:43.000000Z\",\"updated_at\":\"2021-03-17T11:07:43.000000Z\",\"description\":\"These are any important images on your page that you'd like to test alternatives for. Such as product image, header image etc. This does not include any background image.\",\"order_experiment\":44,\"platform_experiment\":[]},{\"id\":39,\"name\":\"Custom HTML element (advanced)\",\"slug\":\"custom_html_element\",\"selector\":null,\"new_element\":1,\"created_at\":\"2021-01-22T11:28:36.000000Z\",\"updated_at\":\"2021-01-22T11:28:36.000000Z\",\"description\":\"If there's any other element on the page not specified above that you'd like to test variations for, this is a kind of \\\"catch all\\\" element. You can run an experiment on any element by modifying it's HTML code directly in the next step.\",\"order_experiment\":240,\"platform_experiment\":[]}],\"pricingExperiments\":[],\"selectedExperimentsIds\":[],\"newExperiment\":[],\"runningOrSavedElement\":[]}}},\"experiments\":[]}"; optimizeScripturl="https://cdn.autooptimize.ai/js/ExperimentLive.js"; } var script = document.createElement('script'); script.type = "text/javascript"; script.src = optimizeScripturl; script.setAttribute('data-script',"autoOptimizescript"); script.setAttribute('test-mode',"true"); script.setAttribute('data-userid',"eyJpdiI6InJZTkF3dTlmUVlCWkdpTFNmZXBTU0E9PSIsInZhbHVlIjoiblQxVk42YjdJZVByN2haVUdZK3ZqQT09IiwibWFjIjoiZTI1M2NjZTJiODhiMzY5YWYwNmMzMWRjOTVmOWQxYWYzN2VkMzA4MjQwOGU3ZGVmZDUwODIxYzk1Y2MyYWUzOCJ9"); if(document.currentScript.getAttribute('data-launch') != undefined){ script.setAttribute('data-launch',"yes"); } document.getElementsByTagName('head')[0].appendChild(script); var link = document.createElement('link'); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css'; document.getElementsByTagName('head')[0].appendChild(link); var refreshCookieInterval = setInterval(() => { if ($_RELOAD_COOKIE) { $_RELOAD_COOKIE = false; $_COOKIE = document.cookie; } }, 20); function callAPI(url) { const response = fetch(url); response.then(function (a) { return a.json(); // call the json method on the response to get JSON }) .then(function(data) { if(data.hasIntercom == true ){ window.intercomSettings = { app_id: data.app_id, created_at: data.created_at, email: data.email, name: data.name }; window.show_tour = data.show_tour; if(data.tour_data == null || data.tour_data == ''){ window.tourData = '{"a":false,"b":false,"c":false,"d":false,"e":false,"f":false,"g":false}'; } else { window.tourData = data.tour_data; } } }).catch(function (err) { console.log('none'); }) } function callAPIOld(url) { const response = fetch(url); response.then(function (a) { return a.json(); // call the json method on the response to get JSON }) .then(function(data) { if(data.hasIntercom == true ){ window.intercomSettings = { app_id: data.app_id, created_at: data.created_at, email: data.email, name: data.name }; window.show_tour = data.show_tour; } }) } window.getCookie = function(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } //}