T.Im
T.Im

Reputation: 159

How to get a geoID for the Google Analytics Measurement Protocol from a zipcode or coords?

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

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

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

format of Googles CSV File

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

  • Geoid 1014315
  • city Sunnyvale
  • Cononical name Sunnyvale,California,United States
  • parent id 21137 (i beleave this is state id in the case of the usa)
  • country code US
  • 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

Related Questions