setApplicationName("Hello Analytics Reporting"); $client->setAuthConfig($KEY_FILE_LOCATION); $client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']); $analytics = new Google_Service_AnalyticsReporting($client); return $analytics; } /** * Queries the Analytics Reporting API V4. * * @param service An authorized Analytics Reporting API V4 service object. * @return The Analytics Reporting API V4 response. */ function getReport($analytics) { // Replace with your view ID, for example XXXX. $VIEW_ID = "118849341"; // Create the DateRange object. $dateRange = new Google_Service_AnalyticsReporting_DateRange(); $dateRange->setStartDate("yesterday"); $dateRange->setEndDate("today"); // Create the Metrics object. $sessions = new Google_Service_AnalyticsReporting_Metric(); $sessions->setExpression("ga:sessions"); $sessions->setAlias("sessions"); $pageviews = new Google_Service_AnalyticsReporting_Metric(); $pageviews->setExpression("ga:pageviews"); $pageviews->setAlias("pageviews"); //Create the Dimensions object. $pagePath = new Google_Service_AnalyticsReporting_Dimension(); $pagePath->setName("ga:pagePath"); $ordering = new Google_Service_AnalyticsReporting_OrderBy(); $ordering->setFieldName("ga:pageviews"); $ordering->setOrderType("VALUE"); $ordering->setSortOrder("DESCENDING"); // Create the ReportRequest object. $request = new Google_Service_AnalyticsReporting_ReportRequest(); $request->setViewId($VIEW_ID); $request->setDateRanges($dateRange); $request->setDimensions(array($pagePath)); $request->setMetrics(array($sessions, $pageviews)); $request->setOrderBys($ordering); $request->setPageSize(1000); $body = new Google_Service_AnalyticsReporting_GetReportsRequest(); $body->setReportRequests( array( $request) ); //var_dump($body); return $analytics->reports->batchGet( $body ); } /** * Parses and prints the Analytics Reporting API V4 response. * @param An Analytics Reporting API V4 response. */ function printResults($reports) { $pages = $reports->reports[0]->data->rows; $arr = []; foreach ($pages as $page) : $slug = $page->dimensions[0]; $count = $page->metrics[0]->values[1]; if (strpos($slug, '/songs-list/') !== false ) { //found at start $arr[] = array($slug, $count); } endforeach; return $arr; } // End Google Anlytics if (isset($_GET['y'])) : $args = array( 'post_type' => 'song', 'posts_per_page' => 300, 'post_status' => 'any', 'tax_query' => array( array( 'taxonomy' => 'mtag', 'field' => 'slug', 'terms' => $_GET['y'], ) ) ); $i = 1; $q = new WP_Query( $args );?> have_posts() ) : $q->the_post(); ?>

Warning: Undefined variable $i in /home/runcloud/webapps/app-boty/wp-content/themes/bestoftheyear/adminapi/mtag.php on line 162
()
false, 'orderby' => 'count', 'order' => 'DESC' ) ); //var_dump( $terms ); ?>
Status Name Index Value GCheck Traffic
description != "" ) { echo ""; echo get_term_meta($year->term_id, "music_nation", true) ? "" : ""; } ?> /home/runcloud/webapps/app-boty/wp-content/themes/bestoftheyear/adminapi/mtag.php on line 216
">
Warning: Attempt to read property "name" on int in /home/runcloud/webapps/app-boty/wp-content/themes/bestoftheyear/adminapi/mtag.php on line 216
(
Warning: Attempt to read property "count" on int in /home/runcloud/webapps/app-boty/wp-content/themes/bestoftheyear/adminapi/mtag.php on line 216
)
term_id, 'mtag', 'noindex' ) == "index") { echo "Index"; } ?> /home/runcloud/webapps/app-boty/wp-content/themes/bestoftheyear/adminapi/mtag.php on line 222
/">G-Check
slug]; ?> term_id, 'mtag_index_status', "yes" ); else : update_term_meta($year->term_id, 'mtag_index_status', null ); endif; endif; if (get_term_meta( $year->term_id, 'mtag_index_status', true ) == "yes") : ?> Google Indexed Google Indexed