WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Tracking how many times the link to Printer Friendly version was clicked

[Resolved] Tracking how many times the link to Printer Friendly version was clicked

Viewing 6 replies - 1 through 6 (of 6 total)
  • Mikey Arce
    Participant

    @mikeyarce

    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?

    TheVirtualPreacher
    Member

    @thevirtualpreacher

    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.

    TheVirtualPreacher
    Member

    @thevirtualpreacher

    Hi mikeyarce,

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

    TheVirtualPreacher
    Member

    @thevirtualpreacher

    TheVirtualPreacher
    Member

    @thevirtualpreacher

    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/

    TheVirtualPreacher
    Member

    @thevirtualpreacher

    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();
    }
    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Tracking how many times the link to Printer Friendly version was clicked’ is closed to new replies.