From 95e5a81cc689dd88a28aa1ed9e7ea5c072c46529 Mon Sep 17 00:00:00 2001 From: harikrishnan Date: Wed, 24 Sep 2014 16:17:15 +0530 Subject: [PATCH] track all analytics for a page with multiple tracking code --- src/jquery.address.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/jquery.address.js b/src/jquery.address.js index 854af48..f0f3634 100644 --- a/src/jquery.address.js +++ b/src/jquery.address.js @@ -95,14 +95,19 @@ .replace(/\/\//, '/').replace(/^\/$/, ''); if ($.isFunction(fn)) { fn(value); - } else if ($.isFunction(_t.urchinTracker)) { + } else { + if ($.isFunction(_t.urchinTracker)) { _t.urchinTracker(value); - } else if (_t.pageTracker !== UNDEFINED && $.isFunction(_t.pageTracker._trackPageview)) { - _t.pageTracker._trackPageview(value); - } else if (_t._gaq !== UNDEFINED && $.isFunction(_t._gaq.push)) { - _t._gaq.push(['_trackPageview', decodeURI(value)]); - } else if ($.isFunction(_t.ga)) { - _t.ga('send', 'pageview', value); + } + if (_t.pageTracker !== UNDEFINED && $.isFunction(_t.pageTracker._trackPageview)) { + _t.pageTracker._trackPageview(value); + } + if (_t._gaq !== UNDEFINED && $.isFunction(_t._gaq.push)) { + _t._gaq.push(['_trackPageview', decodeURI(value)]); + } + if ($.isFunction(_t.ga)) { + _t.ga('send', 'pageview', value); + } } } },