streetlives / yourpeer.nyc

The open source repository behind the yourpeer.nyc web application
https://yourpeer.nyc
MIT License
0 stars 0 forks source link

Capture user's neighborhood with Google Analytics #95

Open adambard1 opened 5 months ago

adambard1 commented 5 months ago

Where are user searches coming from? Possibly we can locate these to the neighborhood level.

jbeard4 commented 5 months ago

Lindsay's comments today were insightful. The current implementation is just using Google's geocoding API to get the neighborhood, but the results from Google match our definition of NYC neighborhood. We may want to do our own translation of lat/lon to NYC neighborhood, and capture this as another Google Analytics dimension.

Here's how we could do this:

  1. Choose a geojson dataset that describes NYC neighborhoods in a way that jives with the NYT map that we are using a reference. Possibly tweak the dataset if we need to make changes to it.
  2. Upload it to Postgres/PostGIS
  3. Expose a geocoding REST API in streetlives-api server that accepts lat/lon, performs geospatial query on postgres, and returns neighborhood + borough

I did some googling and found a couple of data sets that we can use as a starting point. @adambard1 could you please take a look at this one and let me know what you think?

https://data.dathere.com/dataset/nyc-neighborhoods/resource/d6db2e12-fc58-4e41-bc58-5bdfb5078131

Seems to be published under a fairly permissive license called Open Data Commons Attribution License.

Thanks.

adambard1 commented 5 months ago

It seems reasonably detailed @jbeard4. Bit confused with what it does to my neighborhood which it splits into north and south for some reason, though we have no north and south name divide. Not knowing NY 'hoods well, I can't tell how it treats other neighborhoods and how aligned the streets are on boundaries. Is there any way to identify the geocoding behind the NY times map? The border view looks like polygons.