Skip to content

Commit f533603

Browse files
committed
Remove config/setting for user id tracking
1 parent 2845307 commit f533603

5 files changed

Lines changed: 8 additions & 70 deletions

File tree

event/listener.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function load_google_analytics()
6868
$this->template->assign_vars(array(
6969
'GOOGLEANALYTICS_ID' => $this->config['googleanalytics_id'],
7070
'GOOGLEANALYTICS_USER_ID' => $this->user->data['user_id'],
71-
'S_GOOGLEANALYTICS_USER_ID' => $this->config['googleanalytics_track_user_id'] && $this->user->data['is_registered'],
71+
'S_GOOGLEANALYTICS_USER_ID' => $this->user->data['is_registered'],
7272
));
7373
}
7474

@@ -99,16 +99,11 @@ public function add_googleanalytics_configs($event)
9999
'type' => 'text:40:20',
100100
'explain' => true,
101101
),
102-
'googleanalytics_track_user_id' => array(
103-
'lang' => 'ACP_GOOGLEANALYTICS_TRACK_USER_ID',
104-
'validate' => 'bool',
105-
'type' => 'radio:yes_no',
106-
'explain' => true,
107-
),
108102
);
109103

110104
// Add the new config vars after warnings_expire_days in the display_vars config array
111-
$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $ga_config_vars, array('after' => 'warnings_expire_days'));
105+
$insert_after = array('after' => 'warnings_expire_days');
106+
$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $ga_config_vars, $insert_after);
112107

113108
// Update the display_vars event with the new array
114109
$event['display_vars'] = $display_vars;

language/en/googleanalytics_acp.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
$lang = array_merge($lang, array(
4141
'ACP_GOOGLEANALYTICS' => 'Google Analytics',
4242
'ACP_GOOGLEANALYTICS_ID' => 'Google Analytics ID',
43-
'ACP_GOOGLEANALYTICS_ID_EXPLAIN' => 'Enter your Google Analytics ID code, e.g.: <samp>UA-0000000-00</samp>.',
43+
'ACP_GOOGLEANALYTICS_ID_EXPLAIN' => 'Enter your Google Analytics ID code, e.g.: <samp>UA-0000000-00</samp>.<br /><br />Google Analytics can track your registered users across multiple devices and sessions, for a more accurate user count in your reports. To enable this enhanced functionality it must be configured in your Google Analytics account. <a href="https://support.google.com/analytics/answer/3123666">Click for more information</a>.',
4444
'ACP_GOOGLEANALYTICS_ID_INVALID' => '“%s” is not a valid Google Analytics ID code.<br />It should be in the form “UA-0000000-00”.',
45-
'ACP_GOOGLEANALYTICS_TRACK_USER_ID' => 'Enable user ID tracking',
46-
'ACP_GOOGLEANALYTICS_TRACK_USER_ID_EXPLAIN' => 'If enabled, Google Analytics will track your registered users across multiple devices and sessions, for a more accurate user count in your reports. This functionality must also be enabled and configured in your Google Analytics account. <a href="https://support.google.com/analytics/answer/3123666">Click for more information</a>.',
4745
));

migrations/v10x/m2_track_user_id.php

Lines changed: 0 additions & 55 deletions
This file was deleted.

styles/all/template/event/overall_header_stylesheets_after.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
77

88
ga('create', '{{ GOOGLEANALYTICS_ID }}', 'auto');
9-
{% if S_GOOGLEANALYTICS_USER_ID %}
9+
{% if S_GOOGLEANALYTICS_USER_ID -%}
1010
ga('set', 'userId', {{ GOOGLEANALYTICS_USER_ID }});
11-
{% endif %}
12-
{% EVENT phpbb_googleanalytics_alter_ga_requirements %}
11+
{% endif -%}
12+
{% EVENT phpbb_googleanalytics_alter_ga_requirements -%}
1313
ga('send', 'pageview');
1414
</script>
1515
{% endif %}

tests/event/listener_test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function test_load_google_analytics()
9898
->with(array(
9999
'GOOGLEANALYTICS_ID' => $this->config['googleanalytics_id'],
100100
'GOOGLEANALYTICS_USER_ID' => $this->user->data['user_id'],
101-
'S_GOOGLEANALYTICS_USER_ID' => $this->config['googleanalytics_track_user_id'] && $this->user->data['is_registered'],
101+
'S_GOOGLEANALYTICS_USER_ID' => $this->user->data['is_registered'],
102102
));
103103

104104
$dispatcher = new \Symfony\Component\EventDispatcher\EventDispatcher();

0 commit comments

Comments
 (0)