aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2014-04-04 11:05:34 +0100
committerStruan Donald <struan@exo.org.uk>2014-04-04 12:06:47 +0100
commit23da5da5f3a64d34e9fd961122e44ff6b4dc913b (patch)
tree7d57c00f1c9b78997e4ba7097110094370e45799 /web/js
parente7c4041b4a9f78d6fdb8b86445256b521b6830ef (diff)
send a virtual page view when we click on the map
Only if universal analytics turned on and on the fixmystreet cobrand
Diffstat (limited to 'web/js')
-rw-r--r--web/js/map-OpenLayers.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 49f4257eb..c7bfef2b0 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -488,6 +488,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
},
trigger: function(e) {
+ var cobrand = $('meta[name="cobrand"]').attr('content');
if (typeof fixmystreet.nav_control != 'undefined') {
fixmystreet.nav_control.disableZoomWheel();
}
@@ -586,6 +587,9 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet.page = 'new';
location.hash = 'report';
+ if ( typeof ga !== 'undefined' && cobrand == 'fixmystreet' ) {
+ ga('send', 'pageview', { 'page': '/map_click' } );
+ }
}
});