• Resolved nickaster

    (@nickaster)


    HI guys, looks like a cool plugin. I don’t really care much about having a dashboard inside wordpress.

    What I’m interested in is being able to track my posts by Tag, Category and Author using Google Analytics. It seems like it really ought to be possible. Does this plugin help in any way to get this done?

    Thanks!

    https://wordpress.org/plugins/google-analyticator/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Also want to know this.

    Hi Nickaster,

    If you could detail exactly what you want we will look to add this to the next version.

    Thanks

    Thread Starter nickaster

    (@nickaster)

    Cool.

    Well, we hired some guys to build this out for us and they did a pretty good job. You can see the code on TriplePundit.com and I’m happy to share the analytics with you if you want.

    In a nutshell, the questions we’re trying to answer are:

    1) Who is my most popular author?
    2) Track all the traffic from a specific author over time.
    3) What is my most popular category? And track it
    3) What are my most popular tags? And track ’em….

    I’m still sort of amazed that more people don’t talk about these questions as they seem pretty fundamental. Anyway, what we’ve got built right now is still something of a hack. For example, Google won’t separate tags. So if I have three posts tagged as follows:

    1) bananas
    2) apples
    3) bananas, apples.

    Then it actually thinks that’s 3 different tags. So the hack solution is to filter my google results just for “bananas” and it will show both “bananas” and “bananas, apples” but not “apples”. It’s kinda crappy, but it works for 95% of my needs.

    Anyway, that may have been too much information, but there ya go!

    Hi Nickaster,

    Thats exactly what I’m looking for, and I’ve just added some custom dimensions in GA for the following, which is code I’ve added to the “Additional tracking code” (before) section in the plugin settings.

    ga('set', 'dimension1', pubDate);
    ga('set', 'dimension2', author);
    ga('set', 'dimension3', category);

    These are set in the code by PHP, and created as javascript with the following piece of code:

    <?php
    global $post;
    $post_author_id = get_post_field( 'post_author', $post->ID );
    $post_author_name = get_the_author_meta('user_firstname', $post_author_id);
    $category = get_the_category();
    
    // add GA custom variables to a single post
    if (is_single () ) {	 
    
    	echo "
    	<script>
    		var pubDate = '".get_the_time('F j, Y', $post->ID) ."';
    		var author = '".$post_author_name ."';
    		var category = '".$category[0]->cat_name ."';
    	</script>";
    } else {
    	echo "
    	<script>
    		var pubDate = '';
    		var author = '';
    		var category = '';
    	</script>";
    };
    ?>

    I *think* this will work, but I can’t test it until tomorrow while GA gets some initial data.

    Is this similar to how you’ve done it? I’ve had a guy create a few custom reports for me directly in Google Analytics in order to filter by the published date using a regular expression.

    Interested to hear more.

    I have the code now live on my site http://onepopz.com if you want to compare.

    Thread Starter nickaster

    (@nickaster)

    Hey cool… I’m not good enough with JS or PHP to tell the difference, I’m afraid.

    Would be interesting if you’ve managed to get GA to parse out the tags, however!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Some basic questions… Identifying Tag, Category, Author…’ is closed to new replies.