Reputation: 159
is it possible to get a geoID for the Geographical Override parameter in the Google Analytics Measurement Protocol from a zipcode or coordinates?
Upvotes: 2
Views: 1677
Reputation: 117136
Geographical Override The geographical location of the user. The geographical ID should be a two letter country code or a criteria ID representing a city or region (see Geographical IDs). This parameter takes precedent over any location derived from IP address, including the IP Override parameter. An invalid code will result in geographical dimensions to be set to '(not set)'.
You will need to download the file found at Geographical IDs and then parse it against some kind of world wide zip code list in order to parse your zipcodes into Geoiids.
Sending a zip code to Google analytics isnt going to work it must be a valid GeoId
The file from google is a CSV with the following columns Criteria ID,Name,Canonical Name,Parent ID,Country Code,Target Type,Status
"1014315","Sunnyvale","Sunnyvale,California,United States","21137","US","City",Active
Note: small towns and villages will probably not be listed. You will have to try to find something as close as you can get
Upvotes: 1