WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] which Javascript collects stats? (3 posts)

  1. gonlos
    Member
    Posted 1 year ago #

    I'd like to know which javascript script must be included on a webpage so that Jetpack can collect stats for that page.
    I ask this because I wrote a page which redirects to the main page of my site and I'd like to collect stats for that redirect page.

    http://wordpress.org/extend/plugins/jetpack/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    If you check your site's source code while being logged out of your account, you will find a few lines of Javascript right before the closing </body> tag, starting with <script src="$http://stats.wordpress.com/

    That's the Javascript code you should add to your page. However, this code also includes references to the page or post ID, so you will have to be careful when adding that code to page that doesn't have an ID (because it's outside of your WordPress installation, if I understand correctly).

  3. gonlos
    Member
    Posted 1 year ago #

    But of course! I had looked at the code for a page but I dind't think I should be logged out to se the script. I thought it would appear but not count me. But this makes more sense.

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic