Embed API - Map Chart - Region with space in name

362 views
Skip to first unread message

Yarmo Mackenbach

unread,
Jan 5, 2015, 12:58:24 PM1/5/15
to google-analytics...@googlegroups.com
Hello all,

I was fiddling around with the new Embed API, and I noticed an annoying bug. As far as I could see, this hasn't been reported yet. Sorry if it has been already!

The code is basically a map showing the sessions in different provinces in the Netherlands.
And I do see the map with the regions colored... EXCEPT for the provinces/regions containing a space in their name! In this case: North Brabant, South Holland and North Holland.

Please help me here if someone knows a fix or a workaround, or else, please let the API guys know this!

Thanks,
Yarmo


var map = new gapi.analytics.googleCharts.DataChart({
    query: {
      ids: 'ga:XXXXX',
      metrics: 'ga:sessions',
      dimensions: 'ga:region',
      'filters': 'ga:country==Netherlands',
      'start-date': '30daysAgo',
      'end-date': 'yesterday'
    },
    chart: {
      container: 'map-container',
      type: 'GEO',
      options: {
        width: '100%',
        region: 'NL',
        resolution: 'provinces'
      }
    }
  });

Yarmo Mackenbach

unread,
Jan 5, 2015, 1:32:04 PM1/5/15
to google-analytics...@googlegroups.com
I ran a new test, this time with France, same problem...
However, this time, one province with spaces in their name did pass: "Pays de la Loire".
Others like "Picardy" (no spaces) also did NOT pass...

Is there a language translation problem then??? Region names not matching?

Yarmo Mackenbach

unread,
Jan 6, 2015, 8:23:18 AM1/6/15
to google-analytics...@googlegroups.com
Surely, others have had these problems too!

When I did the same test for provinces in Blegium, none were colored!!! Whereas the same map in Google Analytics was!

Is there something I am doing wrong?


On Monday, January 5, 2015 6:58:24 PM UTC+1, Yarmo Mackenbach wrote:

chris@shufflepoint

unread,
Jan 20, 2015, 11:30:59 AM1/20/15
to google-analytics...@googlegroups.com
See this thread
https://groups.google.com/forum/#!topic/google-analytics-data-export-api/Oqf7MtJSddo
My solution was to map country names to ISO codes for use in Google maps

chris@shufflepoint

unread,
Jan 22, 2015, 12:50:08 PM1/22/15
to google-analytics...@googlegroups.com
I see now they have ISO Code versions of geo dimensions
ga:countryIsoCode
ga:regionIsoCode



On Tuesday, January 6, 2015 at 8:23:18 AM UTC-5, Yarmo Mackenbach wrote:

Pete

unread,
Jan 26, 2015, 2:59:48 PM1/26/15
to google-analytics...@googlegroups.com
yes, use IsoCode dimensions, this should fix the problem.
Reply all
Reply to author
Forward
0 new messages