>
Download This Plugin | |
Download Elegant Themes | |
Name | Google Analytics Top Content Widget |
Version | 1.5.6 |
Author | Jtsternberg |
Rating | 100 |
Last updated | 2015-01-09 06:54:00 |
Downloads |
12447
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Google Analytics Top Content Widget plugin added 2 bytes of resources to the Home page and 17 bytes of resources to the sample Post page.
Google Analytics Top Content Widget plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Google Analytics Top Content Widget plugin ads no tables to your Wordpress blog database.Adds a widget that allows you to display top pages/posts in your sidebar based on google analytics data.
Requires a Google Analytics account, and the plugin, "Google Analytics Dashboard" (which will be auto-installed by this plugin, thanks to @jthomasgriffin's awesome TGM Plugin Activation Class).
Also includes a shortcode to display the top content in your posts and pages.
[google_top_content pageviews=5 number=10 showhome=no time=2628000 timeval=2]
[google_analytics_views]
[google_analytics_views]This page has received **count** views.[/google_analytics_views]
All of the widget options are exactly that.. optional. If you don't include them it will pick some defaults.
add_filter( 'gtc_pages_filter', 'gtc_add_viewcount_title' );
function gtc_add_viewcount_title( $pages ) {
if ( !$pages )
return false;
// loop through the pages
foreach ( $pages as $key => $page ) {
// and add the page count to the title value
$pages[$key]['children']['value'] = $pages[$key]['children']['value'] . ' ['. $pages[$key]['children']['children']['ga:pageviews'] .' Views]';
}
return $pages;
}
Feel free to fork or contribute on Github.