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