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

  1. gonlos
    Posted 3 years 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.


  2. Jeremy Herve
    Jetpack Mechanic
    Plugin Author

    Posted 3 years 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
    Posted 3 years 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

  • Jetpack by WordPress.com
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic