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
ga4-demographic-chart.php
91 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Demographic Chart view. |
| 4 | * |
| 5 | * @package GoogleAnalytics |
| 6 | */ |
| 7 | |
| 8 | if (!defined('ABSPATH')) exit; |
| 9 | ?> |
| 10 | <?php if ( false === $ga4_demo_enabled ) : ?> |
| 11 | <div class="demo-ad ga-panel ga-panel-default" style="margin-top: 2rem; width:100%; max-width:1210px;"> |
| 12 | <div class="ga-panel-heading"> |
| 13 | <strong> |
| 14 | <?php esc_html_e( 'Get Demographic Data!', 'googleanalytics' ); ?> |
| 15 | <button id="demographic-popup"> |
| 16 | <?php esc_html_e( 'Click Here To Enable', 'googleanalytics' ); ?> |
| 17 | </button> |
| 18 | </strong> |
| 19 | </div> |
| 20 | <img src="<?php echo esc_url( trailingslashit( get_home_url() ) . 'wp-content/plugins/googleanalytics/assets/images/demographics-ad.png' ); ?>"/> |
| 21 | </div> |
| 22 | <?php elseif (true === empty($gender_count_data)) : ?> |
| 23 | <div class="demo-ad ga-panel ga-panel-default" style="margin-top: 2rem; width:100%; max-width:1210px;"> |
| 24 | <div class="ga-panel-heading"> |
| 25 | <strong> |
| 26 | <?php |
| 27 | esc_html_e( |
| 28 | "If no demographics data is shown, you'll most likely need to do one of the following:", |
| 29 | 'googleanalytics' |
| 30 | ); |
| 31 | ?> |
| 32 | <br> |
| 33 | <ol> |
| 34 | <li> |
| 35 | <?php esc_html_e( |
| 36 | 'Enable "Demographics" within Google Analytics.', |
| 37 | 'googleanalytics' |
| 38 | ); ?> |
| 39 | </li> |
| 40 | <li> |
| 41 | <?php |
| 42 | esc_html_e( |
| 43 | 'If you just enabled this feature, it may require a refresh prior to seeing data.', |
| 44 | 'googleanalytics' |
| 45 | ); |
| 46 | ?> |
| 47 | </li> |
| 48 | <li> |
| 49 | <?php |
| 50 | esc_html_e( |
| 51 | 'Wait until there\'s sufficient Demographic data to display.', |
| 52 | 'googleanalytics' |
| 53 | ); |
| 54 | ?> |
| 55 | </li> |
| 56 | </ol> |
| 57 | </strong> |
| 58 | </div> |
| 59 | </div> |
| 60 | <?php else : ?> |
| 61 | <div class="demo-ad ga-panel ga-panel-default" style="width:100%; max-width:1210px; margin-top: 2rem;"> |
| 62 | <div class="ga-panel-heading"> |
| 63 | <strong> |
| 64 | <?php esc_html_e( 'Demographic by users', 'googleanalytics' ); ?> |
| 65 | </strong> |
| 66 | </div> |
| 67 | <div class="ga-demo-chart"> |
| 68 | <div class="ga-panel-body ga-chart gender"> |
| 69 | <div id="ga4_demo_chart_gender_div" style="width: 100%;"></div> |
| 70 | <div class="ga-loader-wrapper stats-page"> |
| 71 | <div class="ga-loader stats-page-loader"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div class="ga-panel-body ga-chart age"> |
| 75 | <div id="ga4_demo_chart_age_div" style="width: 100%;"></div> |
| 76 | <div class="ga-loader-wrapper stats-page"> |
| 77 | <div class="ga-loader stats-page-loader"></div> |
| 78 | </div> |
| 79 | </div> |
| 80 | </div> |
| 81 | <div class="ga-panel-body ga-chart device" style="max-width: 550px;"> |
| 82 | <div id="demo_ga4_chart_device_div" style="width: 100%;"></div> |
| 83 | <div class="ga-loader-wrapper stats-page"> |
| 84 | <div class="ga-loader stats-page-loader"></div> |
| 85 | </div> |
| 86 | </div> |
| 87 | </div> |
| 88 | <hr> |
| 89 | <?php |
| 90 | endif; |
| 91 |