WordPress.org

Ready to get started?Download WordPress

Forums

Google Analyticator
[resolved] Tracking how many times the link to Printer Friendly version was clicked (7 posts)

  1. TheVirtualPreacher
    Member
    Posted 1 year ago #

    Hi guys,

    In my blog each post is linked to a printer friendly version, (most of the entries are reference material in nature). I use the latest version WP-Print by Lester Chan to make this possible.

    The question is, whether there is an option in Google Analyticator to track visitations to this link and how can I implement it.

    http://wordpress.org/extend/plugins/google-analyticator/

  2. mikeyarce
    Member
    Posted 1 year ago #

    Google Analytics, if set-up properly, will track every click on your site. When you log into the GA dashboard, can you see any data for the print-friendly version of your site in your analytics?

  3. TheVirtualPreacher
    Member
    Posted 1 year ago #

    Well, I don't

    Exactly why I am asking this question =)

    Like I said I am using the plugin Google Analyticator.

    I really don't know if there's anything else to be done other than configuring the plugin properly.

  4. TheVirtualPreacher
    Member
    Posted 1 year ago #

    Hi mikeyarce,

    I think I figured it out. It's being tested now and I will let you know whether it worked or not.

  5. TheVirtualPreacher
    Member
    Posted 1 year ago #


  6. TheVirtualPreacher
    Member
    Posted 1 year ago #

    mikeyarce,

    You were right. Google Analyticator does not place the tracking code in printer friendly pages by defaut. (this is because they don't exist but generated by WP-Print upon request and removed once the page is printed)

    So this is how you can implement the tracking code in to printer friendly pages, (assuming you use WP-Print).

    1. Copy and paste the tracking code into notepad and save it as "analyticstracking.php" (without the quotes)

    2. Upload file "analyticstracking.php" to wp-content/plugins/wp-print

    3. Open wp-content/plugins/wp-print/print-posts.php

    4. Place <?php include_once("analyticstracking.php") ?> immediately after the opening <body> tag

    5. Save and exit

    Now every time a visitor requests a printer friendly page of a post in your blog, Analytics will log the request as /post_url/print/

  7. TheVirtualPreacher
    Member
    Posted 1 year ago #

    Hmmm...

    The above method was a disaster. Try this one.

    1. Removed Google Analyticator plugin and installed Google Analytics by Joose de Valk.

    2. In the plugin configuration page selected "Insert Manually" from the drop down menu "Where should the tracking code be placed:"

    3. Copied and pasted the code below in "header.php" right after the opening body tag as well as "print-posts.php" and saved the changes.

    <?php
    if ( function_exists( 'yoast_analytics' ) ) {
    yoast_analytics();
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic