templates
3 years ago
ga-accounts-selector.php
4 years ago
ga-auth-button.php
3 years ago
ga-code.php
4 years ago
ga-dashboard-widget.php
4 years ago
ga-debug-modal.php
4 years ago
ga-ga4-settings.php
3 years ago
ga-googleanalytics-loader.php
4 years ago
ga-notice.php
3 years ago
ga-oauth-notice.php
4 years ago
ga-wp-notice.php
4 years ago
old-page.php
3 years ago
page.php
3 years ago
statistics.php
3 years ago
stats.php
3 years ago
trending.php
4 years ago
page.php
74 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Page view. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | $optimize_code = get_option( 'googleanalytics_optimize_code' ); |
| 9 | $universal = get_option( 'googleanalytics_enable_universal_analytics', true ); |
| 10 | $anonymization = get_option( 'googleanalytics_ip_anonymization', true ); |
| 11 | $debug_mode = get_option( 'googleanalytics_enable_debug_mode', 'off' ); |
| 12 | $gdpr_config = get_option( 'googleanalytics_gdpr_config' ); |
| 13 | $sharethis_property = get_option( 'googleanalytics_sharethis_terms' ); |
| 14 | $plugin_dir = plugin_dir_path( __FILE__ ); |
| 15 | $plugin_uri = trailingslashit( get_home_url() ) . 'wp-content/plugins/googleanalytics/'; |
| 16 | $has_code = filter_input(INPUT_GET, 'code'); |
| 17 | $has_code = isset($has_code) ? $has_code : false; |
| 18 | $is_ua = filter_input( INPUT_GET, 'ua' ); |
| 19 | $is_ua = true === isset( $is_ua ) ? 't' === $is_ua : false; |
| 20 | $has_property = get_option('googleanalytics-ga4-property'); |
| 21 | $has_property = isset($has_property) ? $has_property : false; |
| 22 | $ga4_optimize = get_option('googleanalytics-ga4-optimize'); |
| 23 | $ga4_optimize = isset($ga4_optimize) ? $ga4_optimize : false; |
| 24 | $ga4_exclude_roles = get_option('googleanalytics-ga4-exclude-roles'); |
| 25 | $ga4_exclude_roles = isset($ga4_exclude_roles) ? $ga4_exclude_roles : false; |
| 26 | $ga4_demo = get_option('googleanalytics-ga4-demo'); |
| 27 | $ga4_demo = true === isset( $ga4_demo ) ? $ga4_demo : false; |
| 28 | $ga4_ip = get_option('googleanalytics-ga4-ip-anon'); |
| 29 | $ga4_ip = isset($ga4_ip) ? $ga4_ip : false; |
| 30 | $ga4_gdpr = get_option('googleanalytics-ga4-gdpr'); |
| 31 | $ga4_gdpr = isset($ga4_gdpr) ? $ga4_gdpr : false; |
| 32 | $ga_nonce = wp_create_nonce('ga4-setup'); |
| 33 | $setup_done = false !== $has_property && |
| 34 | ( |
| 35 | false !== $ga4_gdpr || |
| 36 | false !== $ga4_demo || |
| 37 | false !== $ga4_exclude_roles || |
| 38 | false !== $ga4_optimize || |
| 39 | false !== $ga4_ip |
| 40 | ); |
| 41 | ?> |
| 42 | <?php echo wp_kses_post( $data['debug_modal'] ); ?> |
| 43 | <div class="wrap ga-wrap do-flex"> |
| 44 | <div class="ga4-settings-wrap setting-tab-content st-notice-there engage |
| 45 | <?php echo true === $setup_done ? ' normal-settings' : ''; |
| 46 | echo false !== $has_code && false === $is_ua ? ' engage' : ''; |
| 47 | ?>"> |
| 48 | <?php include 'ga-ga4-settings.php'; ?> |
| 49 | </div> |
| 50 | <?php |
| 51 | // If GDPR isn't enabled show ad otherwise show demo ad. |
| 52 | if ( true === empty( $gdpr_config ) ) { |
| 53 | include $plugin_dir . 'templates/sidebar/gdpr-ad.php'; |
| 54 | } else { |
| 55 | // If Demo is not enabled show ad. |
| 56 | if ( true === empty( get_option( 'googleanalytics_demographic' ) ) ) { |
| 57 | include $plugin_dir . 'templates/sidebar/demo-ad.php'; |
| 58 | } |
| 59 | } |
| 60 | ?> |
| 61 | <p class="ga-love-text"><?php esc_html_e( 'Love this plugin?' ); ?> <a |
| 62 | href="https://wordpress.org/support/plugin/googleanalytics/reviews/#new-post"><?php esc_html_e( ' Please help spread the word by leaving a 5-star review!' ); ?> </a> |
| 63 | </p> |
| 64 | </div> |
| 65 | <script type="text/javascript"> |
| 66 | const GA_DISABLE_FEATURE_URL = '<?php echo esc_url( Ga_Helper::create_url( admin_url( Ga_Helper::GA_SETTINGS_PAGE_URL ), array( Ga_Controller_Core::ACTION_PARAM_NAME => 'ga_action_disable_all_features' ) ) ); ?>'; |
| 67 | const GA_ENABLE_FEATURE_URL = '<?php echo esc_url( Ga_Helper::create_url( admin_url( Ga_Helper::GA_SETTINGS_PAGE_URL ), array( Ga_Controller_Core::ACTION_PARAM_NAME => 'ga_action_enable_all_features' ) ) ); ?>'; |
| 68 | jQuery( document ).ready( function() { |
| 69 | ga_switcher.init( '<?php echo esc_js( $data[ Ga_Admin::GA_DISABLE_ALL_FEATURES ] ); ?>' ); |
| 70 | } ); |
| 71 | </script> |
| 72 | <?php |
| 73 | require 'templates/demo-popup.php'; |
| 74 |