diff --git a/airtime_mvc/application/common/GoogleAnalytics.php b/airtime_mvc/application/common/GoogleAnalytics.php index 00a95a51e..2a8d0184b 100644 --- a/airtime_mvc/application/common/GoogleAnalytics.php +++ b/airtime_mvc/application/common/GoogleAnalytics.php @@ -9,6 +9,9 @@ class Application_Common_GoogleAnalytics public static function generateGoogleTagManagerDataLayerJavaScript() { $code = ""; + if (LIBRETIME_ENABLE_GOOGLE_ANALYTICS !== true) { + return $code; + } try { $clientId = Application_Model_Preference::GetClientId(); @@ -55,6 +58,11 @@ class Application_Common_GoogleAnalytics /** Generate the JavaScript snippet that logs a trial to paid conversion */ public static function generateConversionTrackingJavaScript() { + $code = ""; + if (LIBRETIME_ENABLE_GOOGLE_ANALYTICS !== true) { + return $code; + } + $newPlan = Application_Model_Preference::GetPlanLevel(); $oldPlan = Application_Model_Preference::GetOldPlanLevel(); diff --git a/airtime_mvc/application/configs/constants.php b/airtime_mvc/application/configs/constants.php index bc30f3b49..bb046fcda 100644 --- a/airtime_mvc/application/configs/constants.php +++ b/airtime_mvc/application/configs/constants.php @@ -104,6 +104,9 @@ define('UI_PLAYLISTCONTROLLER_OBJ_SESSNAME', 'PLAYLISTCONTROLLER_OBJ'); /*define('UI_PLAYLIST_SESSNAME', 'PLAYLIST'); define('UI_BLOCK_SESSNAME', 'BLOCK');*/ +// Google Analytics integration +define('LIBRETIME_ENABLE_GOOGLE_ANALYTICS', false); + //WHMCS integration define('LIBRETIME_ENABLE_WHMCS', false); define('WHMCS_PASSWORD_RESET_URL', 'https://account.example.com/pwreset.php'); diff --git a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php index f0239e413..4d325a809 100644 --- a/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php +++ b/airtime_mvc/application/controllers/plugins/PageLayoutInitPlugin.php @@ -240,11 +240,6 @@ class PageLayoutInitPlugin extends Zend_Controller_Plugin_Abstract $view->headScript()->appendFile($baseUrl . 'js/airtime/common/livechat.js?' . $CC_CONFIG['airtime_version'], 'text/javascript'); } } - - /* - if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1) { - $view->headScript()->appendFile($baseUrl.'js/libs/google-analytics.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); - }*/ } protected function _initViewHelpers() diff --git a/airtime_mvc/application/layouts/scripts/layout.phtml b/airtime_mvc/application/layouts/scripts/layout.phtml index a2df4dc76..de0b245f8 100644 --- a/airtime_mvc/application/layouts/scripts/layout.phtml +++ b/airtime_mvc/application/layouts/scripts/layout.phtml @@ -9,6 +9,7 @@ + @@ -18,7 +19,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-55N6NH'); - + partial('partialviews/trialBox.phtml', array("is_trial"=>$this->isTrial(), "trial_remain"=> $this->trialRemaining())) ?>
diff --git a/airtime_mvc/public/js/libs/google-analytics.js b/airtime_mvc/public/js/libs/google-analytics.js deleted file mode 100644 index 5a9352270..000000000 --- a/airtime_mvc/public/js/libs/google-analytics.js +++ /dev/null @@ -1,9 +0,0 @@ -var _gaq = _gaq || []; -_gaq.push(['_setAccount', 'UA-28765064-1']); -_gaq.push(['_trackPageview']); - -(function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); -})();