I'd like to track WMS requests on my openlayers web interface. How is it possible to log on my server or in Google Analytics every WMS requests (GetMap and GetFeatureInfo would be enough)? Then I'd like to make statistics based on query string in WMS requests. This way I'll know what layers get the most interest from my users.


We use Google Analytic's Event Trackingto track all the zooms done, layers turned on and off, etc ..

It is quite straight forward.

Set up you Analytics JS in your page then issue a tracking call like this on every zoom or Layer Switch or whatever you want to track

map.events.on({ "zoomend": function (e) {

  ga('send', 'event', 'Zoom', 'Level', this.getZoom(), {'nonInteraction': 1});

If you want to monitor Layers, use the LoadEnd Event to put the tracking code and change the variables 'Zoom' etc to suit the level of detail you want to track.

Of course, you get all the nice stuff like the demographics, browser types, os types as well.


Without knowing your server specifics are difficult to provide, but if you are using Geoserver as your server there is robust logging built in. See this for reference: http://docs.geoserver.org/latest/en/user/webadmin/server/globalsettings.html#globalsettings.

  • I need to track in openlayers because not all WMS requests go to my server, I also let users request external WMS servers. – Nicolas Boisteault May 22 '14 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.