{"id":3811,"date":"2021-02-03T15:06:42","date_gmt":"2021-02-03T15:06:42","guid":{"rendered":"https:\/\/www.leadshook.com\/help\/?p=3811"},"modified":"2024-06-13T13:47:42","modified_gmt":"2024-06-13T13:47:42","slug":"google-places-extra-address-verification-script","status":"publish","type":"post","link":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/","title":{"rendered":"Google Places &#8211; extra Address verification script"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong style=\"color:red;\">PLEASE NOTE: This script is provided to help you get started. Unfortunately, our free support does not include custom scripts. Any competent JS developer should be able to manipulate this script for your needs. Please contact us if you need help to find a developer. Please thoroughly test before use.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When using real time address verification sometimes Google allows addresses through without a house number, street address, or post code.<\/li>\n\n\n\n<li>To address this we provide a script to ensure a user cannot proceed to the next node unless the address is valid.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In a question node of type &#8220;address&#8221;, setup a node level script to look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"427\" height=\"235\" src=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png\" alt=\"\" class=\"wp-image-3812\" srcset=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png 427w, https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1-300x165.png 300w, https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1-60x33.png 60w, https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1-150x83.png 150w\" sizes=\"(max-width: 427px) 100vw, 427px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Then copy paste the following code:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script>\n  var interval = setInterval(nodeLoaded, 500);\n  \n  \/\/ Check if node is loaded\n  function nodeLoaded() {\n    var button = document.querySelector('#forward-button');\n    var input = document.querySelector('.form-control');\n    \n    \/\/ If the button and input are not null, they are in the DOM\n    if (button &amp;&amp; input) {\n      console.log(\"Button and input are loaded!\");\n\n      \/\/attach the event listener\n      button.addEventListener(\"click\", function(event){\n      \n        \/\/get input value ( address )  \n        var val = input.value;\n        \n        \/\/check if address contains any digits (street numbers)\";\n        var matches = val.match(\/\\d+\/g);\n        if (matches != null) {\n            console.log(val + \" submitted!\");\n\n            \/\/ If Angular is available in your environment\n            if(window.angular){\n                \/\/ Get the Angular scope\n                var scope = angular.element(document.querySelector('.app')).scope();\n\n                \/\/ If the scope and next function are available\n                if(scope &amp;&amp; typeof scope.next === \"function\"){\n                    \/\/ Use Angular's digest cycle to update the view\n                    scope.$apply(function(){\n                        scope.next();\n                    });\n                }\n            }\n            \n        } else {\n            console.log(val + \" rejected!\");\n            alert(\"You must enter a Valid Complete address\");          \n            \/\/prevent submission of button\n            event.preventDefault(); \n            return false;\n        }    \n      });\n\n      \/\/ Clear Interval Function when button and input are loaded\n      clearInterval(interval);\n    }\n  }\n&lt;\/script><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can see a demo of this here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/test2.leadshook.io\/survey\/I7X1ZW34Bh5WXisLixiu9pRvi2sxmSwtIQatHAxu\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/test2.leadshook.io\/survey\/I7X1ZW34Bh5WXisLixiu9pRvi2sxmSwtIQatHAxu<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">( Try entering a city name, eg: &#8220;Sydney&#8221;. It wont let you submit the address as it contains no street number )<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PLEASE NOTE: This script is provided to help you get started. Unfortunately, our free support does not include custom scripts. Any competent JS developer should be able to manipulate this script for your needs. Please contact us if you need help to find a developer. Please thoroughly test before use. In a question node of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[242,12,620],"tags":[204,797,226,202,182,567,798,434],"class_list":["post-3811","post","type-post","status-publish","format-standard","hentry","category-data-validation","category-leadshook","category-scripts","tag-address","tag-extra","tag-google","tag-number","tag-places","tag-script","tag-street","tag-verification"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Google Places - extra Address verification script - LeadsHook Knowledge Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Places - extra Address verification script - LeadsHook Knowledge Base\" \/>\n<meta property=\"og:description\" content=\"PLEASE NOTE: This script is provided to help you get started. Unfortunately, our free support does not include custom scripts. Any competent JS developer should be able to manipulate this script for your needs. Please contact us if you need help to find a developer. Please thoroughly test before use. In a question node of [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/\" \/>\n<meta property=\"og:site_name\" content=\"LeadsHook Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/leadshook\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-03T15:06:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-13T13:47:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png\" \/>\n<meta name=\"author\" content=\"Nik T\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@leadshook\" \/>\n<meta name=\"twitter:site\" content=\"@leadshook\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nik T\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/\"},\"author\":{\"name\":\"Nik T\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/person\\\/4bfe37d814563cc729828b7055313f4d\"},\"headline\":\"Google Places &#8211; extra Address verification script\",\"datePublished\":\"2021-02-03T15:06:42+00:00\",\"dateModified\":\"2024-06-13T13:47:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/\"},\"wordCount\":161,\"publisher\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/image-1.png\",\"keywords\":[\"address\",\"extra\",\"Google\",\"number\",\"places\",\"script\",\"street\",\"verification\"],\"articleSection\":[\"Data Validation\",\"LeadsHook\",\"Scripts\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/\",\"name\":\"Google Places - extra Address verification script - LeadsHook Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/image-1.png\",\"datePublished\":\"2021-02-03T15:06:42+00:00\",\"dateModified\":\"2024-06-13T13:47:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/image-1.png\",\"contentUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/image-1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/google-places-extra-address-verification-script\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Places &#8211; extra Address verification script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#website\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\",\"name\":\"LeadsHook Knowledge Base\",\"description\":\"LeadsHook Training &amp; Technical Help\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#organization\",\"name\":\"LeadsHook\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/leadshook-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/wp-content\\\/uploads\\\/2018\\\/12\\\/leadshook-logo.png\",\"width\":350,\"height\":83,\"caption\":\"LeadsHook\"},\"image\":{\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/leadshook\\\/\",\"https:\\\/\\\/x.com\\\/leadshook\",\"https:\\\/\\\/www.linkedin.com\\\/showcase\\\/leadshook\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/#\\\/schema\\\/person\\\/4bfe37d814563cc729828b7055313f4d\",\"name\":\"Nik T\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g\",\"caption\":\"Nik T\"},\"sameAs\":[\"http:\\\/\\\/www.LeadsHook.com\"],\"url\":\"https:\\\/\\\/www.leadshook.com\\\/help\\\/author\\\/nik\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Places - extra Address verification script - LeadsHook Knowledge Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/","og_locale":"en_US","og_type":"article","og_title":"Google Places - extra Address verification script - LeadsHook Knowledge Base","og_description":"PLEASE NOTE: This script is provided to help you get started. Unfortunately, our free support does not include custom scripts. Any competent JS developer should be able to manipulate this script for your needs. Please contact us if you need help to find a developer. Please thoroughly test before use. In a question node of [&hellip;]","og_url":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/","og_site_name":"LeadsHook Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/leadshook\/","article_published_time":"2021-02-03T15:06:42+00:00","article_modified_time":"2024-06-13T13:47:42+00:00","og_image":[{"url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png","type":"","width":"","height":""}],"author":"Nik T","twitter_card":"summary_large_image","twitter_creator":"@leadshook","twitter_site":"@leadshook","twitter_misc":{"Written by":"Nik T","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#article","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/"},"author":{"name":"Nik T","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d"},"headline":"Google Places &#8211; extra Address verification script","datePublished":"2021-02-03T15:06:42+00:00","dateModified":"2024-06-13T13:47:42+00:00","mainEntityOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/"},"wordCount":161,"publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png","keywords":["address","extra","Google","number","places","script","street","verification"],"articleSection":["Data Validation","LeadsHook","Scripts"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/","url":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/","name":"Google Places - extra Address verification script - LeadsHook Knowledge Base","isPartOf":{"@id":"https:\/\/www.leadshook.com\/help\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#primaryimage"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#primaryimage"},"thumbnailUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png","datePublished":"2021-02-03T15:06:42+00:00","dateModified":"2024-06-13T13:47:42+00:00","breadcrumb":{"@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#primaryimage","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2021\/02\/image-1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.leadshook.com\/help\/google-places-extra-address-verification-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.leadshook.com\/help\/"},{"@type":"ListItem","position":2,"name":"Google Places &#8211; extra Address verification script"}]},{"@type":"WebSite","@id":"https:\/\/www.leadshook.com\/help\/#website","url":"https:\/\/www.leadshook.com\/help\/","name":"LeadsHook Knowledge Base","description":"LeadsHook Training &amp; Technical Help","publisher":{"@id":"https:\/\/www.leadshook.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.leadshook.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.leadshook.com\/help\/#organization","name":"LeadsHook","url":"https:\/\/www.leadshook.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","contentUrl":"https:\/\/www.leadshook.com\/help\/wp-content\/uploads\/2018\/12\/leadshook-logo.png","width":350,"height":83,"caption":"LeadsHook"},"image":{"@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/leadshook\/","https:\/\/x.com\/leadshook","https:\/\/www.linkedin.com\/showcase\/leadshook\/"]},{"@type":"Person","@id":"https:\/\/www.leadshook.com\/help\/#\/schema\/person\/4bfe37d814563cc729828b7055313f4d","name":"Nik T","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/48d53e68db0b1db1cd5c54a750130fb2ee0c663306ff1bd434373f1a368ef7a0?s=96&d=mm&r=g","caption":"Nik T"},"sameAs":["http:\/\/www.LeadsHook.com"],"url":"https:\/\/www.leadshook.com\/help\/author\/nik\/"}]}},"_links":{"self":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/comments?post=3811"}],"version-history":[{"count":6,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3811\/revisions"}],"predecessor-version":[{"id":7413,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/posts\/3811\/revisions\/7413"}],"wp:attachment":[{"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/media?parent=3811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/categories?post=3811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.leadshook.com\/help\/wp-json\/wp\/v2\/tags?post=3811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}