sidebar
2 months ago
appearance.php
2 months ago
date-custom-range-filter.php
2 months ago
demo-popup.php
2 months ago
demographic-chart.php
2 months ago
demographic.php
2 months ago
exclusions.php
2 months ago
ga4-dashboard.php
2 months ago
ga4-demographic-chart.php
2 months ago
gdpr-config.php
2 months ago
gdpr.php
2 months ago
purposes.php
2 months ago
demographic-chart.php
107 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Demographic Chart view. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | if (!defined('ABSPATH')) exit; |
| 9 | |
| 10 | ?> |
| 11 | <?php if ( false === $demo_enabled ) : ?> |
| 12 | <div class="demo-ad ga-panel ga-panel-default"> |
| 13 | <div class="ga-panel-heading"> |
| 14 | <strong> |
| 15 | <?php esc_html_e( 'Get Demographic Data!', 'googleanalytics' ); ?> |
| 16 | <button id="demographic-popup"> |
| 17 | <?php esc_html_e( 'Click Here To Enable', 'googleanalytics' ); ?> |
| 18 | </button> |
| 19 | </strong> |
| 20 | </div> |
| 21 | <img src="<?php echo esc_url( trailingslashit( get_home_url() ) . 'wp-content/plugins/googleanalytics/assets/images/demographics-ad.png' ); ?>"/> |
| 22 | </div> |
| 23 | <?php elseif ( false === empty( $need_account_demo_enable ) ) : ?> |
| 24 | <div class="demo-ad ga-panel ga-panel-default"> |
| 25 | <div class="ga-panel-heading"> |
| 26 | <strong> |
| 27 | <?php |
| 28 | esc_html_e( |
| 29 | "If no demographics data is shown, you'll most likely need to do one of the following:", |
| 30 | 'googleanalytics' |
| 31 | ); |
| 32 | ?> |
| 33 | <br> |
| 34 | <ol> |
| 35 | <li><?php esc_html_e( 'Enable "Demographics" within Google Analytics.', 'googleanalytics' ); ?></li> |
| 36 | <li> |
| 37 | <?php |
| 38 | esc_html_e( |
| 39 | 'If you just enabled this feature, it may require a refresh prior to seeing data.', |
| 40 | 'googleanalytics' |
| 41 | ); |
| 42 | ?> |
| 43 | </li> |
| 44 | <li> |
| 45 | <?php |
| 46 | esc_html_e( |
| 47 | 'Wait until there\'s sufficient Demographic data to display.', |
| 48 | 'googleanalytics' |
| 49 | ); |
| 50 | ?> |
| 51 | </li> |
| 52 | </ol> |
| 53 | |
| 54 | <a href="<?php echo esc_url( $demographic_page_url ); ?>/" class="view-report" target="_blank"> |
| 55 | <?php esc_html_e( 'Go to my account', 'googleanalytics' ); ?> |
| 56 | </a> |
| 57 | </strong> |
| 58 | </div> |
| 59 | </div> |
| 60 | <?php else : ?> |
| 61 | <div class="filter-choices"> |
| 62 | <?php |
| 63 | Ga_Template::load( |
| 64 | 'templates/date-custom-range-filter', |
| 65 | array( |
| 66 | 'date_from' => $date_range['from'], |
| 67 | 'date_to' => $date_range['to'], |
| 68 | ) |
| 69 | ); |
| 70 | ?> |
| 71 | </div> |
| 72 | <div class="demo-ad ga-panel ga-panel-default"> |
| 73 | <div class="ga-panel-heading"> |
| 74 | <strong> |
| 75 | <?php esc_html_e( 'Demographic by sessions', 'googleanalytics' ); ?> |
| 76 | </strong> |
| 77 | </div> |
| 78 | <div class="ga-demo-chart"> |
| 79 | <div class="ga-panel-body ga-chart gender"> |
| 80 | <div id="demo_chart_gender_div" style="width: 100%;"></div> |
| 81 | <div class="ga-loader-wrapper stats-page"> |
| 82 | <div class="ga-loader stats-page-loader"></div> |
| 83 | </div> |
| 84 | </div> |
| 85 | <div class="ga-panel-body ga-chart gender"> |
| 86 | <div id="demo_chart_age_div" style="width: 100%;"></div> |
| 87 | <div class="ga-loader-wrapper stats-page"> |
| 88 | <div class="ga-loader stats-page-loader"></div> |
| 89 | </div> |
| 90 | </div> |
| 91 | </div> |
| 92 | <div class="ga-demo-chart"> |
| 93 | <div class="ga-panel-body ga-chart device"> |
| 94 | <div id="demo_chart_device_div" style="width: 100%;"></div> |
| 95 | <div class="ga-loader-wrapper stats-page"> |
| 96 | <div class="ga-loader stats-page-loader"></div> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | <a href="<?php echo esc_url( $demographic_page_url ); ?>/" class="view-report" target="_blank"> |
| 102 | <?php esc_html_e( 'View Full Report', 'googleanalytics' ); ?> |
| 103 | </a> |
| 104 | <hr> |
| 105 | <?php |
| 106 | endif; |
| 107 |