Viewing 4 replies - 1 through 4 (of 4 total)
  • Maybe you can change this period manually in google-analytics-top-posts-widget.php in this part of code:

    `$defaults = array(
    ‘post_id’ => get_the_ID(),
    ‘start_date’ => date( ‘Y-m-d’, time() – ( DAY_IN_SECONDS * 30 ) ),
    ‘end_date’ => date( ‘Y-m-d’ ),
    );

    I changed nuber 30 and it is working in my case.

    Thread Starter SventB

    (@sventb)

    Thank you, it works.
    Quick’n’dirty.
    I hope the author will make this configurable one time…

    Plugin Author Justin Sternberg

    (@jtsternberg)

    All of those values are configurable via the ‘gtc_atts_filter_analytics_views’ filter. If you modify the plugin, your modifications will disappear with the next update.

    function modify_gtc_atts_filter_analytics_views( $atts ) {
    
    	$month = DAY_IN_SECONDS * 30;
    	$six_months = $month * 6;
    
    	$atts['start_date'] = date( 'Y-m-d', time() - $six_months );
    
    	return $atts;
    }
    add_filter( 'gtc_atts_filter_analytics_views', 'modify_gtc_atts_filter_analytics_views' );
    Thread Starter SventB

    (@sventb)

    Hi Justin,
    thank you very much for your help! ??
    Sorry for not knowing WordPress as good as I should… ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Configure period for [google_analytics_views]’ is closed to new replies.