I was rending map with my google analytics data using embed api as:
(function(w,d,s,g,js,fs){ g=w.gapi||(w.gapi={});g.analytics={q:[],ready:function(f){this.q.push(f);}}; js=d.createElement(s);fs=d.getElementsByTagName(s)[0]; js.src='https://apis.google.com/js/platform.js'; fs.parentNode.insertBefore(js,fs);js.onload=function(){g.load('analytics');}; }(window,document,'script')); gapi.analytics.auth.authorize({ serverAuth: { access_token: 'my access token' } )}; var commonConfig2 = { query: { ids: 'ga:' + gaViewId, metrics: 'ga:users', dimensions: 'ga:region', 'max-results': 5, sort : '-ga:users' }, chart: { type: 'GEO', container: 'timeline', options: { displayMode: 'markers', width: '100%' } } }; var dataChart3 = new gapi.analytics.googleCharts.DataChart(commonConfig2) .set({query: dateRange1}) .set({chart: {container: 'chart-3-container'}});
Map was rendering fine. But few days back i got error "Google Maps API error: MissingKeyMapError" and map is no longer rending. After some googling i came to know that google now require Api key to access its api. How can i set api key with my existing code.
gapi.client.setApiKey(apiKey)
– WhiteHat