Widget and shortcode to display top content according to Google Analytics. ("Google Analytics Dashboard" plugin required)
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]
Since 1.3:
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;
}
Requires: 3.0 or higher
Compatible up to: 3.5.1
Last Updated: 2013-5-20
Downloads: 4,194
Got something to say? Need help?