diff --git a/ext/google_analytics/main.php b/ext/google_analytics/main.php index 494604fa..f1ef0b08 100644 --- a/ext/google_analytics/main.php +++ b/ext/google_analytics/main.php @@ -11,23 +11,18 @@ class google_analytics extends Extension { # Add analytics to config public function onSetupBuilding(SetupBuildingEvent $event) { - global $config; - $sb = new SetupBlock("Google Analytics"); $sb->add_text_option("google_analytics_id", "Analytics ID: "); $sb->add_label("
(eg. UA-xxxxxxxx-x)"); - $event->panel->add_block($sb); } # Load Analytics tracking code on page request public function onPageRequest(PageRequestEvent $event) { - global $config; - global $page; + global $config, $page; $google_analytics_id = $config->get_string('google_analytics_id',''); - if (stristr($google_analytics_id, "UA-")) - { + if (stristr($google_analytics_id, "UA-")) { $page->add_html_header("