diff --git a/.gitignore b/.gitignore
index 56923c8..8cdd5d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
/node_modules/
/coverage-report/
+.idea
diff --git a/.idea/google-analytics.iml b/.idea/google-analytics.iml
deleted file mode 100644
index c956989..0000000
--- a/.idea/google-analytics.iml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 28a804d..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 191311c..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
deleted file mode 100644
index c8dd8fd..0000000
--- a/.idea/workspace.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- register_
- register_public_scripts
-
-
-
-
-
-
-
-
-
-
-
- true
- DEFINITION_ORDER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1554824927820
-
-
- 1554824927820
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Classes/Loader.php b/Classes/Loader.php
index 2a53cd9..c1b2c6d 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,34 @@ 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');
?>