From 23da5da5f3a64d34e9fd961122e44ff6b4dc913b Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Fri, 4 Apr 2014 11:05:34 +0100 Subject: send a virtual page view when we click on the map Only if universal analytics turned on and on the fixmystreet cobrand --- web/js/map-OpenLayers.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'web/js/map-OpenLayers.js') 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' } ); + } } }); -- cgit v1.2.3