ga_accounts_selector.php
9 years ago
ga_auth_button.php
9 years ago
ga_code.php
6 years ago
ga_dashboard_widget.php
9 years ago
ga_debug_modal.php
8 years ago
ga_googleanalytics_loader.php
6 years ago
ga_notice.php
8 years ago
ga_oauth_notice.php
9 years ago
ga_wp_notice.php
9 years ago
page.php
6 years ago
statistics.php
9 years ago
stats.php
9 years ago
trending.php
8 years ago
page.php
214 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 | ?> |
| 6 | <div id="ga_access_code_modal" class="ga-modal" tabindex="-1"> |
| 7 | <div class="ga-modal-dialog"> |
| 8 | <div class="ga-modal-content"> |
| 9 | <div class="ga-modal-header"> |
| 10 | <span id="ga_close" class="ga-close">×</span> |
| 11 | <h4 class="ga-modal-title"><?php _e( 'Please paste the access code obtained from Google below:' ) ?></h4> |
| 12 | </div> |
| 13 | <div class="ga-modal-body"> |
| 14 | <div id="ga_code_error" class="ga-alert ga-alert-danger" style="display: none;"></div> |
| 15 | <label for="ga_access_code"><strong><?php _e( 'Access Code' ); ?></strong>:</label> |
| 16 | <input id="ga_access_code_tmp" type="text" |
| 17 | placeholder="<?php _e( 'Paste your access code here' ) ?>"/> |
| 18 | <div class="ga-loader-wrapper"> |
| 19 | <div class="ga-loader"></div> |
| 20 | </div> |
| 21 | </div> |
| 22 | <div class="ga-modal-footer"> |
| 23 | <button id="ga_btn_close" type="button" class="button">Close</button> |
| 24 | <button type="button" class="button-primary" |
| 25 | id="ga_save_access_code" |
| 26 | onclick="ga_popup.saveAccessCode( event )"><?php _e( 'Save Changes' ); ?></button> |
| 27 | </div> |
| 28 | </div><!-- /.modal-content --> |
| 29 | </div><!-- /.modal-dialog --> |
| 30 | </div><!-- /.modal --> |
| 31 | <?php echo $data[ 'debug_modal' ] ?> |
| 32 | <div class="wrap ga-wrap"> |
| 33 | <h2>Google Analytics - <?php _e( 'Settings' ); ?></h2> |
| 34 | <div class="ga_container"> |
| 35 | <?php if ( ! empty( $data['error_message'] ) ) : ?> |
| 36 | <?php echo $data['error_message']; ?> |
| 37 | <?php endif; ?> |
| 38 | <form id="ga_form" method="post" action="options.php"> |
| 39 | <?php settings_fields( 'googleanalytics' ); ?> |
| 40 | <input id="ga_access_code" type="hidden" |
| 41 | name="<?php echo esc_attr( Ga_Admin::GA_OAUTH_AUTH_CODE_OPTION_NAME ); ?>" value=""/> |
| 42 | <table class="form-table"> |
| 43 | <tr valign="top"> |
| 44 | <?php if ( ! empty( $data['popup_url'] ) ): ?> |
| 45 | <th scope="row"> |
| 46 | <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php echo _e( 'Google Profile' ) ?> |
| 47 | : |
| 48 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 49 | </label> |
| 50 | </th> |
| 51 | <td <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="ga-tooltip"' : ''; ?>> |
| 52 | <?php echo $data[ 'auth_button' ] ?> |
| 53 | <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span> |
| 54 | <?php if ( ! empty( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] ) ): ?> |
| 55 | <div class="ga_warning"> |
| 56 | <strong><?php _e( 'Notice' ) ?></strong>: <?php _e( 'Please uncheck the "Manually enter Tracking ID" option to authenticate and view statistics.' ); ?> |
| 57 | </div> |
| 58 | <?php endif; ?> |
| 59 | </td> |
| 60 | <?php endif; ?> |
| 61 | |
| 62 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 63 | <th scope="row"><?php echo _e( 'Google Analytics Account' ) ?>:</th> |
| 64 | <td> |
| 65 | <?php echo $data['ga_accounts_selector']; ?> |
| 66 | </td> |
| 67 | <?php endif; ?> |
| 68 | |
| 69 | </tr> |
| 70 | |
| 71 | <tr valign="top"> |
| 72 | |
| 73 | <th scope="row"> |
| 74 | <div class="checkbox"> |
| 75 | <label class="ga_checkbox_label <?php echo Ga_Helper::get_code_manually_label_classes() ?>" |
| 76 | for="ga_enter_code_manually"> <input |
| 77 | <?php if ( Ga_Helper::are_features_enabled() ) : ?> |
| 78 | onclick="ga_events.click( this, ga_events.codeManuallyCallback( <?php echo Ga_Helper::are_features_enabled() ? 1 : 0; ?> ) )" |
| 79 | <?php endif; ?> |
| 80 | type="checkbox" |
| 81 | <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?> |
| 82 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 83 | id="ga_enter_code_manually" |
| 84 | value="1" |
| 85 | <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_terms_accepted() ) ? 'checked="checked"' : '' ); ?>/> |
| 86 | <?php _e( 'Manually enter Tracking ID' ) ?> |
| 87 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 88 | </label> |
| 89 | <?php if ( ! Ga_Helper::are_features_enabled() ) : ?> |
| 90 | <input id="ga_enter_code_manually_hidden" type="hidden" |
| 91 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ); ?>" |
| 92 | value="1"/> |
| 93 | <?php endif; ?> |
| 94 | </div> |
| 95 | </th> |
| 96 | <td></td> |
| 97 | </tr> |
| 98 | <tr valign="top" |
| 99 | id="ga_manually_wrapper" <?php echo( ( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_OPTION_NAME ] || ! Ga_Helper::are_features_enabled() ) ? '' : 'style="display: none"' ); ?> > |
| 100 | |
| 101 | <th scope="row"><?php _e( 'Tracking ID' ) ?>:</th> |
| 102 | <td> |
| 103 | <input type="text" |
| 104 | name="<?php echo esc_attr( Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ); ?>" |
| 105 | value="<?php echo esc_attr( $data[ Ga_Admin::GA_WEB_PROPERTY_ID_MANUALLY_VALUE_OPTION_NAME ] ); ?>" |
| 106 | id="ga_manually_input"/> |
| 107 | <div class="ga_warning"> |
| 108 | <strong><?php _e( 'Warning' ); ?></strong>: <?php _e( 'If you enter your Tracking ID manually, Analytics statistics will not be shown.' ); ?> |
| 109 | <br> |
| 110 | <?php _e( 'We strongly recommend to authenticate with Google using the button above.' ); ?> |
| 111 | </div> |
| 112 | </td> |
| 113 | |
| 114 | </tr> |
| 115 | |
| 116 | <tr valign="top" id="ga_roles_wrapper"> |
| 117 | <th scope="row"> |
| 118 | <label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'class="label-grey ga-tooltip"' : '' ?>><?php _e( 'Exclude Tracking for Roles' ) ?> |
| 119 | : |
| 120 | <span class="ga-tooltiptext ga-tt-abs"><?php _e( $tooltip ); ?></span> |
| 121 | </label> |
| 122 | </th> |
| 123 | <td> |
| 124 | |
| 125 | |
| 126 | <?php |
| 127 | if ( ! empty( $data['roles'] ) ) { |
| 128 | $roles = $data['roles']; |
| 129 | foreach ( $roles as $role ) { |
| 130 | ?> |
| 131 | <div class="checkbox"> |
| 132 | <label class="ga_checkbox_label <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'label-grey ga-tooltip' : ''; ?>" |
| 133 | for="checkbox_<?php echo $role['id']; ?>"> |
| 134 | <input id="checkbox_<?php echo $role['id']; ?>" type="checkbox" |
| 135 | <?php echo ( ! Ga_Helper::are_features_enabled() ) ? 'disabled="disabled"' : ''; ?> |
| 136 | name="<?php echo esc_attr( Ga_Admin::GA_EXCLUDE_ROLES_OPTION_NAME . "[" . $role['id'] . "]" ); ?>" |
| 137 | id="<?php echo esc_attr( $role['id'] ); ?>" |
| 138 | <?php echo esc_attr( ( $role['checked'] ? 'checked="checked"' : '' ) ); ?> /> |
| 139 | <?php echo esc_html( $role['name'] ); ?> |
| 140 | <span class="ga-tooltiptext"><?php _e( $tooltip ); ?></span> |
| 141 | </label> |
| 142 | </div> |
| 143 | <?php |
| 144 | } |
| 145 | } |
| 146 | ?> |
| 147 | |
| 148 | </td> |
| 149 | </tr> |
| 150 | <tr valign="top"> |
| 151 | <th scope="row"><?php _e( 'Enable IP Anonymization' ) ?>:</th> |
| 152 | <td> |
| 153 | <label class="ga-switch"> |
| 154 | <input id="ga-anonymization" name="googleanalytics_ip_anonymization" |
| 155 | type="checkbox" <?php echo checked( $anonymization, 'on' ); ?>> |
| 156 | <div id="ga-slider" class="ga-slider round"></div> |
| 157 | </label |
| 158 | </td> |
| 159 | </tr> |
| 160 | <tr valign="top"> |
| 161 | <th scope="row"><?php _e( 'If using Google Optimize, enter optimize code here' ) ?>:</th> |
| 162 | <td> |
| 163 | <label class="ga-text"> |
| 164 | <input id="ga-optimize" name="googleanalytics_optimize_code" |
| 165 | type="text" placeholder="GTM-XXXXXX" value="<?php echo esc_attr( $optimize_code ); ?>"> |
| 166 | </label |
| 167 | </td> |
| 168 | </tr> |
| 169 | <tr valign="top"> |
| 170 | <th scope="row"><?php _e( 'Disable all features' ) ?>:</th> |
| 171 | <td> |
| 172 | <label class="ga-switch"> |
| 173 | <input id="ga-disable" name="<?php echo Ga_Admin::GA_DISABLE_ALL_FEATURES; ?>" |
| 174 | type="checkbox"> |
| 175 | <div id="ga-slider" class="ga-slider-disable ga-slider round"></div> |
| 176 | </label |
| 177 | </td> |
| 178 | </tr> |
| 179 | </table> |
| 180 | |
| 181 | <p class="submit"> |
| 182 | <input type="submit" class="button-primary" |
| 183 | value="<?php _e( 'Save Changes' ) ?>"/> |
| 184 | </p> |
| 185 | </form> |
| 186 | </div> |
| 187 | <tr valign="top"> |
| 188 | <td colspan="2"> |
| 189 | <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> |
| 190 | <p> |
| 191 | <button id="ga_debug_button" class="button button-secondary" onclick="ga_debug.open_modal( event )" >Send Debugging Info</button> |
| 192 | <?php if ( ! empty( $data['ga_accounts_selector'] ) ): ?> |
| 193 | <?php echo $data[ 'auth_button' ] ?> |
| 194 | <br> |
| 195 | <small class="notice"> |
| 196 | *If you reset your google password you MUST re-authenticate to continue viewing your analytics dashboard. |
| 197 | </small> |
| 198 | <?php endif; ?> |
| 199 | </p> |
| 200 | </td> |
| 201 | </tr> |
| 202 | |
| 203 | <p class="ga-love-text"><?php _e( 'Love this plugin?' ); ?> <a |
| 204 | href="https://wordpress.org/support/plugin/googleanalytics/reviews/#new-post"><?php _e( ' Please help spread the word by leaving a 5-star review!' ); ?> </a> |
| 205 | </p> |
| 206 | </div> |
| 207 | <script type="text/javascript"> |
| 208 | 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')); ?>'; |
| 209 | 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')); ?>'; |
| 210 | jQuery(document).ready(function () { |
| 211 | ga_switcher.init('<?php echo $data[ Ga_Admin::GA_DISABLE_ALL_FEATURES ]; ?>'); |
| 212 | }); |
| 213 | </script> |
| 214 |