Autocomplete adress fiel with google maps ?


Hi guys, 


We are using a form asking people for an adress, among other things, and we have consistency problems (typos and such) that I would like to solve. 


I would like to make it Autocomplete with the google maps API... Has anyone done this before ? Do you have any clue where to start ? 


Thanks a lot! 


6 Replies 6
Community Manager

Hi @AnaïsB ,


Do you have experience with APIs? As a starting point, I would recommend looking at our API documents


The more information, screenshots and details you can provide, the better the Community can assist.


Thank you,


Hi Jenny, 


Yes, I can play around with APIs, I'm not a developer but I've been using them quite often. 


The thing I'm trying to do is basically turn this : 



(This is a very useful form we set up on our website with Hubspot. It basically offers users the ability to suggest new gyms as partners for us. Works like a charm, but as you can see, the adress fields are free text, which gives us inaccurate adresses quite often.)


... into this :



My main issue is that so far, we have to treat these forms by hand, as typos and basically, freedom of text, make it impossible to match duplicates. One user might ask for "11, example street", another "Example st. 11", and so forth. Using google adresses would provide us with an exact match. 


Do you know how we could implement this ? Is there a way to add a bit of code somewhere in the form to get this autocomplete format ? 


Thanks a lot for your help!


HubSpot Alumni

Hi @AnaïsB ! Happy to help here. This is certainly possible, it just isn't possible out of the box with HubSpot. I've yet to see this on native HubSpot forms, but if you're familiar enough with JavaScript and HTML, you could use this tutorial from Google:


It's pretty in-depth, so if you're not familiar with implementing this type of code and creating a form from scratch, it probably won't suit your needs, but it's always there as an option! If it's a necessary feature, you might want to consider working with a freelancer to implement it if you can't yourself. 


It also might be a neat feature we could have in HubSpot (adding an Address field and subsequent autocomplete features to our forms), so I'd highly recommend posting in our ideas forum about this so our product team can get some visiblity. Once you've done that I'd be happy to upvote and comment on it!

HubSpot Employee

Hi @cbarley 


I am also trying to do this and am very familiar with building forms from scratch - just not Hubspot ones. Is there a tutorial for hand-coding a hubspot form using my own editor? If so that would be very helpful as the Google API bit for the address completion isn't so bad.


many thanks


HubSpot Employee

Hey, @SLDeveloper.


Happy to help here, as @cbarley no longer works at HubSpot.


We don't have any guides on building forms from scratch, but you can hook any custom form you create to HubSpot via our Forms API (we don't have any special rules on the structure or format of your HTML form). The v3 Forms API endpoint I shared supports AJAX, so you could parse and send over the form fields right on your page without having to call your server.

Isaac Takushi

Associate Certification Manager