• Hello,

    My Goal is to sort my posts by pageviews or other values using Google Analytics. So my code would look like this:

    $query = array(
         'posts_per_page' => (int) $count,
         'post_type' => 'post',
         'meta_key' => ???,
         'orderby' => 'meta_value_num',
         'tax_query' => array(
    		array(
    			'taxonomy' => 'category',
    			'field'    => 'name',
    			'terms'    => $cato2,
    		),
    	),
    );

    My Problem is that I don’t know which value to put in ‘meta_key’. I already studied the Google Analytics API but I’m still desperate.

  • The topic ‘Orderby Google Analytics. Meta_key?’ is closed to new replies.