Let me be more clear:
You can setup any properties you want in your Hubspot account, we agree on that right ? So when you go to your Hubspot account and click on the settings.. you have a link called “Properties” in the menu on the left:
When you click on the tab “Contact Properties” these are all the properties you can retrieve from your contacts. Some are pre-set by default in Hubspot, some you can add yourself. In my case, the leadsource property is something that we added ourselves to our Hubspot settings. So you have to check in your own Hubspot settings if that property exists and add it if you need to.
When the property is added in Hubspot, you can retrieve it with the Google App Script by making those changes:
var url_query = API_URL + "/contacts/v1/lists/all/contacts/all?property=firstname&property=lastname&property=[YOUR NEW PROPERTY HERE]";
Fill the [YOUR NEW PROPERTY] with the property you just added. Use the internal name in Hubspot (not the label).
Then you still need to add this
var [YOUR NEW PROPERTY] = (item.properties.hasOwnProperty('[YOUR NEW PROPERTY]')) ? item.properties.[YOUR NEW PROPERTY].value : "NA";
Hope that helps.