templates
5 years ago
ga_accounts_selector.php
9 years ago
ga_auth_button.php
9 years ago
ga_code.php
5 years ago
ga_dashboard_widget.php
9 years ago
ga_debug_modal.php
5 years ago
ga_googleanalytics_loader.php
5 years ago
ga_notice.php
5 years ago
ga_oauth_notice.php
9 years ago
ga_wp_notice.php
9 years ago
page.php
5 years ago
statistics.php
5 years ago
stats.php
5 years ago
trending.php
8 years ago
page.php
319 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 | ?> |
| 7 | <div id="adblocker-notice" class="notice notice-error is-dismissible"> |
| 8 | <p> |
| 9 | <?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' ); ?> |
| 10 | </p> |
| 11 | </div> |
| 12 | <div id="detectadblock"> |
| 13 | <div class="adBanner"> |
| 14 | </div> |
| 15 | </div> |
| 16 | <div id="ga_access_code_modal" class="ga-modal" tabindex="-1"> |
| 17 | <div class="ga-modal-dialog"> |
| 18 | <div class="ga-modal-content"> |
| 19 | <div class="ga-modal-header"> |
| 20 | <span id="ga_close" class="ga-close">×</span> |
| 21 | <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4> |
| 22 | </div> |
| 23 | <div class="ga-modal-body"> |
| 24 | <div id="ga_code_error" class="ga-alert ga-alert-danger" style="display: none;"></div> |
| 25 | <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label> |
| 26 | <input id="ga_access_code_tmp" type="text" |
| 27 | placeholder="<?php _e( 'Paste your access code here' ) ?>"/> |
| 28 | <div class="ga-loader-wrapper"> |
| 29 | <div class="ga-loader"></div> |
| 30 | </div> |
| 31 | </div> |
| 32 | <div class="ga-modal-footer"> |
| 33 | <button id="ga_btn_close" type="button" class="button">Close</button> |
| 34 | <button type="button" class="button-primary" |
| 35 | id="ga_save_access_code" |
| 36 | onclick="ga_popup.saveAccessCode( event )"><?php _e( 'Save Changes' ); ?></button> |
| 37 | </div> |
| 38 | </div><!-- /.modal-content --> |
| 39 | </div><!-- /.modal-dialog --> |
| 40 | </div><!-- /.modal --> |
| 41 | <?php echo $data[ 'debug_modal' ] ?> |
| 42 | <div class="wrap ga-wrap"> |
| 43 | <h2>Google Analytics - <?php _e( 'Settings' ); ?></h2> |
| 44 | <div class="ga_container"> |
| 45 | <?php if ( ! empty( $data['error_message'] ) ) : ?> |
| 46 | <?php echo $data['error_message']; ?> |
| 47 | <?php endif; ?> |
| 48 | <form id="ga_form" method="post" action="options.php"> |
| 49 | <?php settings_fields( 'googleanalytics' ); ?> |
| 50 | <input id="ga_access_code" type="hidden" |
| 51 | name="<?php echo esc_attr( Ga_Admin::GA_OAUTH_AUTH_CODE_OPTION_NAME ); ?>" value=""/> |
| 52 | <table class="form-table"> |
| 53 | <tr valign="top"> |
| 54 | <?php if ( ! empty( $data['popup_url'] ) ): ?> |
| 55 | <th scope="row"> |
| 56 | <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php echo _e( 'Google Profile' ) ?> |
| 57 | : |
| 58 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 59 | </label> |
| 60 | </th> |
| 61 | <td <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="ga-tooltip"' : ''; ?>> |
| 62 | <?php echo $data[ 'auth_button' ] ?> |
| 63 | <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span> |
| 64 | <?php if ( ! empty( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] ) ): ?> |
| 65 | <div class="ga_warning"> |
| 66 | <strong><?php _e( 'Notice' ) ?></strong>: <?php _e( 'Please uncheck the "Manually enter Tracking ID" option to authenticate and view statistics.' ); ?> |
| 67 | </div> |
| 68 | <?php endif; ?> |
| 69 | </td> |
| 70 | <?php endif; ?> |
| 71 | |
| 72 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 73 | <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th> |
| 74 | <?php endif; ?> |
| 75 | </tr> |
| 76 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 77 | <tr valign="top"> |
| 78 | <td> |
| 79 | <?php echo $data['ga_accounts_selector']; ?> |
| 80 | </td> |
| 81 | </tr> |
| 82 | <?php endif; ?> |
| 83 | <tr valign="top"> |
| 84 | <th scope="row"> |
| 85 | <div class="checkbox"> |
| 86 | <label class="ga_checkbox_label <?php echo Ga_Helper::get_code_manually_label_classes() ?>" |
| 87 | for="ga_enter_code_manually"> <input |
| 88 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 89 | onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_features_enabled() ? 1 : 0; ?> ) )" |
| 90 | <?php endif; ?> |
| 91 | type="checkbox" |
| 92 | <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?> |
| 93 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 94 | id="ga_enter_code_manually" |
| 95 | value="1" |
| 96 | <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_terms_accepted() ) ? 'checked="checked"' : '' ); ?>/> |
| 97 | <?php _e( 'Manually enter Tracking ID' ) ?> |
| 98 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 99 | </label> |
| 100 | <?php if ( ! Ga_Helper::are_features_enabled() ) : ?> |
| 101 | <input id="ga_enter_code_manually_hidden" type="hidden" |
| 102 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 103 | value="1"/> |
| 104 | <?php endif; ?> |
| 105 | </div> |
| 106 | </th> |
| 107 | <td></td> |
| 108 | </tr> |
| 109 | <tr valign="top" |
| 110 | id="ga_manually_wrapper" <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_features_enabled() ) ? '' : 'style="display: none"' ); ?> > |
| 111 | |
| 112 | <th scope="row"><?php _e( 'Tracking ID' ) ?>:</th> |
| 113 | </tr> |
| 114 | <tr valing="top"> |
| 115 | <td> |
| 116 | <input type="text" |
| 117 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ); ?>" |
| 118 | value="<?php echo esc_attr( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ] ); ?>" |
| 119 | id="ga_manually_input"/> |
| 120 | <div class="ga_warning"> |
| 121 | <strong><?php _e( 'Warning' ); ?></strong>: <?php _e( 'If you enter your Tracking ID manually, Analytics statistics will not be shown.' ); ?> |
| 122 | <br> |
| 123 | <?php _e( 'We strongly recommend to authenticate with Google using the button above.' ); ?> |
| 124 | </div> |
| 125 | </td> |
| 126 | </tr> |
| 127 | <tr valign="top" id="ga_roles_wrapper"> |
| 128 | <th scope="row"> |
| 129 | <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php _e( 'Exclude Tracking for Roles' ) ?> |
| 130 | : |
| 131 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 132 | </label> |
| 133 | </th> |
| 134 | </tr> |
| 135 | <tr valign="top"> |
| 136 | <td> |
| 137 | <?php |
| 138 | if ( ! empty( $data['roles'] ) ) { |
| 139 | $roles = $data['roles']; |
| 140 | foreach ( $roles as $role ) { |
| 141 | ?> |
| 142 | <div class="checkbox"> |
| 143 | <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : ''; ?>" |
| 144 | for="checkbox_<?php echo $role['id']; ?>"> |
| 145 | <input id="checkbox_<?php echo $role['id']; ?>" type="checkbox" |
| 146 | <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?> |
| 147 | name="<?php echo esc_attr( Ga_Admin::GA_EXCLUDE_ROLES_OPTION_NAME . "[" . $role['id'] . "]" ); ?>" |
| 148 | id="<?php echo esc_attr( $role['id'] ); ?>" |
| 149 | <?php echo esc_attr( ( $role['checked'] ? 'checked="checked"' : '' ) ); ?> /> |
| 150 | <?php echo esc_html( $role['name'] ); ?> |
| 151 | <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span> |
| 152 | </label> |
| 153 | </div> |
| 154 | <?php |
| 155 | } |
| 156 | } |
| 157 | ?> |
| 158 | </td> |
| 159 | </tr> |
| 160 | <tr valign="top"> |
| 161 | <th scope="row"><?php _e( 'Enable IP Anonymization' ) ?>:</th> |
| 162 | </tr> |
| 163 | <tr valign="top"> |
| 164 | <td> |
| 165 | <label class="ga-switch <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>"> |
| 166 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 167 | <input id="ga-anonymization" name="googleanalytics_ip_anonymization" |
| 168 | type="checkbox" <?php echo checked( $anonymization, 'on' ); ?>> |
| 169 | |
| 170 | <div id="ga-slider" class="ga-slider round"></div> |
| 171 | <?php else: ?> |
| 172 | <input id="ga-anonymization" name="googleanalytics_ip_anonymization" |
| 173 | type="checkbox" disabled="disabled"> |
| 174 | |
| 175 | <div id="ga-slider" class="ga-slider round"></div> |
| 176 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 177 | <?php endif; ?> |
| 178 | </label> |
| 179 | </td> |
| 180 | </tr> |
| 181 | <tr valign="top"> |
| 182 | <th scope="row"><?php _e( 'If using Google Optimize, enter optimize code here' ) ?>:</th> |
| 183 | </tr> |
| 184 | <tr valign="top"> |
| 185 | <td> |
| 186 | <label class="ga-text <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>"> |
| 187 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 188 | <input id="ga-optimize" name="googleanalytics_optimize_code" |
| 189 | type="text" placeholder="GTM-XXXXXX" value="<?php echo esc_attr( $optimize_code ); ?>"> |
| 190 | <?php else: ?> |
| 191 | <input id="ga-optimize" name="googleanalytics_optimize_code" |
| 192 | type="text" placeholder="GTM-XXXXXX" value="<?php echo esc_attr( $optimize_code ); ?>" readonly> |
| 193 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 194 | <?php endif; ?> |
| 195 | </label> |
| 196 | </td> |
| 197 | </tr> |
| 198 | <tr valign="top"> |
| 199 | <th scope="row"><?php _e( 'Disable all features' ) ?>:</th> |
| 200 | </tr> |
| 201 | <tr valign="top"> |
| 202 | <td> |
| 203 | <label class="ga-switch <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>"> |
| 204 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 205 | <input id="ga-disable" name="<?php echo Ga_Admin::GA_DISABLE_ALL_FEATURES; ?>" |
| 206 | type="checkbox"> |
| 207 | <div id="ga-slider" class="ga-slider-disable ga-slider round"></div> |
| 208 | <?php else: ?> |
| 209 | <input id="ga-disable" name="<?php echo Ga_Admin::GA_DISABLE_ALL_FEATURES; ?>" |
| 210 | type="checkbox" disabled="disabled"> |
| 211 | <div id="ga-slider" class="ga-slider-disable ga-slider round"></div> |
| 212 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 213 | <?php endif; ?> |
| 214 | </label> |
| 215 | </td> |
| 216 | </tr> |
| 217 | <?php include plugin_dir_path(__FILE__) . 'templates/gdpr.php'; ?> |
| 218 | </table> |
| 219 | |
| 220 | <p class="submit"> |
| 221 | <input type="submit" class="button-primary" |
| 222 | value="<?php _e( 'Save Changes' ) ?>"/> |
| 223 | </p> |
| 224 | </form> |
| 225 | <?php if(empty($gdpr_config)) : ?> |
| 226 | <div class="sidebar-ad"> |
| 227 | <h2 style="text-decoration: underline;"> |
| 228 | <?php esc_html_e('Check out our new GDPR Compliance Tool!', 'googleanalytics'); ?> |
| 229 | </h2> |
| 230 | <div class="row"> |
| 231 | <div class="col-md-12"> |
| 232 | <img src="<?php echo trailingslashit(get_home_url()) . 'wp-content/plugins/googleanalytics/assets/images/gdpr-ex.png'; ?>" /> |
| 233 | </div> |
| 234 | <div class="col-md-6"> |
| 235 | <h3><?php esc_html_e('Confirm Consent', 'googleanalytics'); ?></h3> |
| 236 | <p> |
| 237 | <?php esc_html_e( |
| 238 | 'A simple and streamlined way to confirm a user’s initial acceptance or rejection of cookie collection', |
| 239 | 'googleanalytics' |
| 240 | ); ?> |
| 241 | </p> |
| 242 | </div> |
| 243 | <div class="col-md-6"> |
| 244 | <h3><?php esc_html_e('Select Purpose', 'googleanalytics'); ?></h3> |
| 245 | <p> |
| 246 | <?php esc_html_e( |
| 247 | 'A transparent system of verifying the intent of collecting a user’s cookies, and giving the option to opt in or out', |
| 248 | 'googleanalytics' |
| 249 | ); ?> |
| 250 | </p> |
| 251 | </div> |
| 252 | </div> |
| 253 | <div class="row"> |
| 254 | <div class="col-md-6"> |
| 255 | <h3><?php esc_html_e('Indicate Company', 'googleanalytics'); ?></h3> |
| 256 | <p> |
| 257 | <?php esc_html_e( |
| 258 | 'A comprehensive record of company-level information that allows users to monitor and control the recipients of cookie collection', |
| 259 | 'googleanalytics' |
| 260 | ); ?> |
| 261 | </p> |
| 262 | </div> |
| 263 | <div class="col-md-6"> |
| 264 | <h3><?php esc_html_e('Access Data Rights', 'googleanalytics'); ?></h3> |
| 265 | <p> |
| 266 | <?php esc_html_e( |
| 267 | 'A centralized database where users can review the latest privacy policies and information pertaining to their cookie collection', |
| 268 | 'googleanalytics' |
| 269 | ); ?> |
| 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <div class="row register-section"> |
| 274 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 275 | <td> |
| 276 | <button class="gdpr-enable"><?php esc_html_e('Enable'); ?></button> |
| 277 | </td> |
| 278 | <?php else : ?> |
| 279 | <td> |
| 280 | <label class="<?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : '' ?>"> |
| 281 | <button class="gdpr-enable" disabled="disabled"><?php esc_html_e('Enable'); ?></button> |
| 282 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 283 | </label> |
| 284 | </td> |
| 285 | <?php endif; ?> |
| 286 | </div> |
| 287 | </div> |
| 288 | <?php endif; ?> |
| 289 | </div> |
| 290 | <?php if ( $data['debug_info'] ) : ?> |
| 291 | <tr valign="top"> |
| 292 | <td colspan="2"> |
| 293 | <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> |
| 294 | <p> |
| 295 | <button id="ga_debug_button" class="button button-secondary" onclick="ga_debug.open_modal( event )" >Send Debugging Info</button> |
| 296 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 297 | <?php echo $data[ 'auth_button' ] ?> |
| 298 | <br> |
| 299 | <small class="notice"> |
| 300 | *If you reset your google password you MUST re-authenticate to continue viewing your analytics dashboard. |
| 301 | </small> |
| 302 | <?php endif; ?> |
| 303 | </p> |
| 304 | </td> |
| 305 | </tr> |
| 306 | <?php endif; ?> |
| 307 | |
| 308 | <p class="ga-love-text"><?php _e( 'Love this plugin?' ); ?> <a |
| 309 | href="https://wordpress.org/support/plugin/googleanalytics/reviews/#new-post"><?php _e( ' Please help spread the word by leaving a 5-star review!' ); ?> </a> |
| 310 | </p> |
| 311 | </div> |
| 312 | <script type="text/javascript"> |
| 313 | 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')); ?>'; |
| 314 | 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')); ?>'; |
| 315 | jQuery(document).ready(function () { |
| 316 | ga_switcher.init('<?php echo $data[ Ga_Admin::GA_DISABLE_ALL_FEATURES ]; ?>'); |
| 317 | }); |
| 318 | </script> |
| 319 |