diff --git a/.gitignore b/.gitignore index 56923c8..e9fa327 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /node_modules/ /coverage-report/ +/.idea \ No newline at end of file diff --git a/Classes/Loader.php b/Classes/Loader.php index 2a53cd9..bb75876 100644 --- a/Classes/Loader.php +++ b/Classes/Loader.php @@ -5,19 +5,6 @@ class Loader { - /** - * Returns whether the current request should be tracked or not - * - * @since 1.2 - * @return boolean - * - */ - function should_track_visit() - { - return (!is_user_logged_in() || get_option('track_logged_in')); - } - - /** * Returns if the cookie is present * @@ -29,13 +16,36 @@ function render_script() { ob_start(); ?> + + + should_track_visit() && get_option('ga_use_tag_manager')) { + if (get_option('ga_use_tag_manager')) { $TAG_MANAGER_ID = get_option('ga_tag_manager_id'); + $this->output_should_track_js_function(); ?> - if (!hasWKGoogleAnalyticsCookie()) { + should_track_visit() && get_option('ga_use_tag_manager')) { + if (get_option('ga_use_tag_manager')) { $TAG_MANAGER_ID = get_option('ga_tag_manager_id'); ?>