PluginProbe ʕ •ᴥ•ʔ
ShareThis Dashboard for Google Analytics / 2.5.2
ShareThis Dashboard for Google Analytics v2.5.2
3.3.2 trunk 1.0.7 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.2.5 2.3.5 2.3.6 2.3.7 2.3.8 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 3.0.0 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3.0 3.3.1
googleanalytics / view / page.php
googleanalytics / view Last commit date
templates 4 years ago ga_accounts_selector.php 9 years ago ga_auth_button.php 9 years ago ga_code.php 7 years ago ga_dashboard_widget.php 9 years ago ga_debug_modal.php 6 years ago ga_googleanalytics_loader.php 7 years ago ga_notice.php 4 years ago ga_oauth_notice.php 9 years ago ga_wp_notice.php 9 years ago page.php 5 years ago statistics.php 6 years ago stats.php 4 years ago trending.php 8 years ago
page.php
269 lines
1 <?php
2 $optimize_code = get_option( 'googleanalytics_optimize_code' );
3 $universal = get_option( 'googleanalytics_enable_universal_analytics', true );
4 $anonymization = get_option( 'googleanalytics_ip_anonymization', true );
5 $gdpr_config = get_option( 'googleanalytics_gdpr_config');
6 $plugin_dir = plugin_dir_path(__FILE__);
7 $plugin_uri = trailingslashit(get_home_url()) . 'wp-content/plugins/googleanalytics/';
8 ?>
9 <div id="adblocker-notice" class="notice notice-error is-dismissible">
10 <p>
11 <?php echo esc_html__( 'It appears you have an ad blocker enabled. To avoid affecting this plugin\'s functionality, please disable while using its admin configurations and registrations. Thank you.', 'sharethis-share-buttons' ); ?>
12 </p>
13 </div>
14 <div id="detectadblock">
15 <div class="adBanner">
16 </div>
17 </div>
18 <div id="ga_access_code_modal" class="ga-modal" tabindex="-1">
19 <div class="ga-modal-dialog">
20 <div class="ga-modal-content">
21 <div class="ga-modal-header">
22 <span id="ga_close" class="ga-close">&times;</span>
23 <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4>
24 </div>
25 <div class="ga-modal-body">
26 <div id="ga_code_error" class="ga-alert ga-alert-danger" style="display: none;"></div>
27 <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label>
28 &nbsp;<input id="ga_access_code_tmp" type="text"
29 placeholder="<?php _e( 'Paste your access code here' ) ?>"/>
30 <div class="ga-loader-wrapper">
31 <div class="ga-loader"></div>
32 </div>
33 </div>
34 <div class="ga-modal-footer">
35 <button id="ga_btn_close" type="button" class="button">Close</button>
36 <button type="button" class="button-primary"
37 id="ga_save_access_code"
38 onclick="ga_popup.saveAccessCode( event )"><?php _e( 'Save Changes' ); ?></button>
39 </div>
40 </div><!-- /.modal-content -->
41 </div><!-- /.modal-dialog -->
42 </div><!-- /.modal -->
43 <?php echo $data[ 'debug_modal' ] ?>
44 <div class="wrap ga-wrap">
45 <h2>Google Analytics - <?php _e( 'Settings' ); ?></h2>
46 <div class="ga_container">
47 <?php if ( ! empty( $data['error_message'] ) ) : ?>
48 <?php echo $data['error_message']; ?>
49 <?php endif; ?>
50 <form id="ga_form" method="post" action="options.php">
51 <?php settings_fields( 'googleanalytics' ); ?>
52 <input id="ga_access_code" type="hidden"
53 name="<?php echo esc_attr( Ga_Admin::GA_OAUTH_AUTH_CODE_OPTION_NAME ); ?>" value=""/>
54 <table class="form-table">
55 <tr valign="top">
56 <?php if ( ! empty( $data['popup_url'] ) ): ?>
57 <th scope="row">
58 <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php echo _e( 'Google Profile' ) ?>
59 :
60 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
61 </label>
62 </th>
63 <td <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="ga-tooltip"' : ''; ?>>
64 <?php echo $data[ 'auth_button' ] ?>
65 <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span>
66 <?php if ( ! empty( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] ) ): ?>
67 <div class="ga_warning">
68 <strong><?php _e( 'Notice' ) ?></strong>:&nbsp;<?php _e( 'Please uncheck the "Manually enter Tracking ID" option to authenticate and view statistics.' ); ?>
69 </div>
70 <?php endif; ?>
71 </td>
72 <?php endif; ?>
73
74 <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
75 <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th>
76 <?php endif; ?>
77 </tr>
78 <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
79 <tr valign="top">
80 <td>
81 <?php echo $data['ga_accounts_selector']; ?>
82 </td>
83 </tr>
84 <?php endif; ?>
85 <tr valign="top">
86 <th scope="row">
87 <div class="checkbox">
88 <label class="ga_checkbox_label <?php echo Ga_Helper::get_code_manually_label_classes() ?>"
89 for="ga_enter_code_manually"> <input
90 <?php if ( Ga_Helper::are_features_enabled() ) : ?>
91 onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_features_enabled() ? 1 : 0; ?> ) )"
92 <?php endif; ?>
93 type="checkbox"
94 <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?>
95 name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>"
96 id="ga_enter_code_manually"
97 value="1"
98 <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_terms_accepted() ) ? 'checked="checked"' : '' ); ?>/>&nbsp;
99 <?php _e( 'Manually enter Tracking ID' ) ?>
100 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
101 </label>
102 <?php if ( ! Ga_Helper::are_features_enabled() ) : ?>
103 <input id="ga_enter_code_manually_hidden" type="hidden"
104 name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>"
105 value="1"/>
106 <?php endif; ?>
107 </div>
108 </th>
109 <td></td>
110 </tr>
111 <tr valign="top"
112 id="ga_manually_wrapper" <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_features_enabled() ) ? '' : 'style="display: none"' ); ?> >
113
114 <th scope="row"><?php _e( 'Tracking ID' ) ?>:</th>
115 </tr>
116 <tr valing="top">
117 <td>
118 <input type="text"
119 name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ); ?>"
120 value="<?php echo esc_attr( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ] ); ?>"
121 id="ga_manually_input"/>&nbsp;
122 <div class="ga_warning">
123 <strong><?php _e( 'Warning' ); ?></strong>:&nbsp;<?php _e( 'If you enter your Tracking ID manually, Analytics statistics will not be shown.' ); ?>
124 <br>
125 <?php _e( 'We strongly recommend to authenticate with Google using the button above.' ); ?>
126 </div>
127 </td>
128 </tr>
129 <tr valign="top" id="ga_roles_wrapper">
130 <th scope="row">
131 <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php _e( 'Exclude Tracking for Roles' ) ?>
132 :
133 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
134 </label>
135 </th>
136 </tr>
137 <tr valign="top">
138 <td>
139 <?php
140 if ( ! empty( $data['roles'] ) ) {
141 $roles = $data['roles'];
142 foreach ( $roles as $role ) {
143 ?>
144 <div class="checkbox">
145 <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : ''; ?>"
146 for="checkbox_<?php echo $role['id']; ?>">
147 <input id="checkbox_<?php echo $role['id']; ?>" type="checkbox"
148 <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?>
149 name="<?php echo esc_attr( Ga_Admin::GA_EXCLUDE_ROLES_OPTION_NAME . "[" . $role['id'] . "]" ); ?>"
150 id="<?php echo esc_attr( $role['id'] ); ?>"
151 <?php echo esc_attr( ( $role['checked'] ? 'checked="checked"' : '' ) ); ?> />&nbsp;
152 <?php echo esc_html( $role['name'] ); ?>
153 <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span>
154 </label>
155 </div>
156 <?php
157 }
158 }
159 ?>
160 </td>
161 </tr>
162 <tr valign="top">
163 <th scope="row"><?php _e( 'Enable IP Anonymization' ) ?>:</th>
164 </tr>
165 <tr valign="top">
166 <td>
167 <label class="ga-switch <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>">
168 <?php if ( Ga_Helper::are_features_enabled() ) : ?>
169 <input id="ga-anonymization" name="googleanalytics_ip_anonymization"
170 type="checkbox" <?php echo checked( $anonymization, 'on' ); ?>>
171
172 <div id="ga-slider" class="ga-slider round"></div>
173 <?php else: ?>
174 <input id="ga-anonymization" name="googleanalytics_ip_anonymization"
175 type="checkbox" disabled="disabled">
176
177 <div id="ga-slider" class="ga-slider round"></div>
178 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
179 <?php endif; ?>
180 </label>
181 </td>
182 </tr>
183 <tr valign="top">
184 <th scope="row"><?php _e( 'If using Google Optimize, enter optimize code here' ) ?>:</th>
185 </tr>
186 <tr valign="top">
187 <td>
188 <label class="ga-text <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>">
189 <?php if ( Ga_Helper::are_features_enabled() ) : ?>
190 <input id="ga-optimize" name="googleanalytics_optimize_code"
191 type="text" placeholder="GTM-XXXXXX" value="<?php echo esc_attr( $optimize_code ); ?>">
192 <?php else: ?>
193 <input id="ga-optimize" name="googleanalytics_optimize_code"
194 type="text" placeholder="GTM-XXXXXX" value="<?php echo esc_attr( $optimize_code ); ?>" readonly>
195 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
196 <?php endif; ?>
197 </label>
198 </td>
199 </tr>
200 <tr valign="top">
201 <th scope="row"><?php _e( 'Disable all features' ) ?>:</th>
202 </tr>
203 <tr valign="top">
204 <td>
205 <label class="ga-switch <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>">
206 <?php if ( Ga_Helper::are_features_enabled() ) : ?>
207 <input id="ga-disable" name="<?php echo Ga_Admin::GA_DISABLE_ALL_FEATURES; ?>"
208 type="checkbox">
209 <div id="ga-slider" class="ga-slider-disable ga-slider round"></div>
210 <?php else: ?>
211 <input id="ga-disable" name="<?php echo Ga_Admin::GA_DISABLE_ALL_FEATURES; ?>"
212 type="checkbox" disabled="disabled">
213 <div id="ga-slider" class="ga-slider-disable ga-slider round"></div>
214 <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span>
215 <?php endif; ?>
216 </label>
217 </td>
218 </tr>
219 <?php include $plugin_dir . 'templates/gdpr.php'; ?>
220 </table>
221
222 <p class="submit">
223 <input type="submit" class="button-primary"
224 value="<?php _e( 'Save Changes' ) ?>"/>
225 </p>
226 </form>
227 <?php
228 // If GDPR isn't enabled show ad otherwise show demo ad.
229 if (empty($gdpr_config)) {
230 include $plugin_dir . 'templates/sidebar/gdpr-ad.php';
231 } else {
232 // If Demo is not enabled show ad.
233 if (! get_option('googleanalytics_demographic')) {
234 include $plugin_dir . 'templates/sidebar/demo-ad.php';
235 }
236 }
237 ?>
238 </div>
239 <?php if ( $data['debug_info'] ) : ?>
240 <tr valign="top">
241 <td colspan="2">
242 <p>If you are still experiencing an issue, we are here to help! We recommend clickingthe "Send Debugging Info" button below and pasting the information within an email to support@sharethis.com.</p>
243 <p>
244 <button id="ga_debug_button" class="button button-secondary" onclick="ga_debug.open_modal( event )" >Send Debugging Info</button>
245 <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?>
246 <?php echo $data[ 'auth_button' ] ?>
247 <br>
248 <small class="notice">
249 *If you reset your google password you MUST re-authenticate to continue viewing your analytics dashboard.
250 </small>
251 <?php endif; ?>
252 </p>
253 </td>
254 </tr>
255 <?php endif; ?>
256
257 <p class="ga-love-text"><?php _e( 'Love this plugin?' ); ?> <a
258 href="https://wordpress.org/support/plugin/googleanalytics/reviews/#new-post"><?php _e( ' Please help spread the word by leaving a 5-star review!' ); ?> </a>
259 </p>
260 </div>
261 <script type="text/javascript">
262 const GA_DISABLE_FEATURE_URL = '<?php echo Ga_Helper::create_url(admin_url(Ga_Helper::GA_SETTINGS_PAGE_URL), array(Ga_Controller_Core::ACTION_PARAM_NAME => 'ga_action_disable_all_features')); ?>';
263 const GA_ENABLE_FEATURE_URL = '<?php echo Ga_Helper::create_url(admin_url(Ga_Helper::GA_SETTINGS_PAGE_URL), array(Ga_Controller_Core::ACTION_PARAM_NAME => 'ga_action_enable_all_features')); ?>';
264 jQuery(document).ready(function () {
265 ga_switcher.init('<?php echo $data[ Ga_Admin::GA_DISABLE_ALL_FEATURES ]; ?>');
266 });
267 </script>
268 <?php include 'templates/demo-popup.php';
269