Jetpack by WordPress.com
[resolved] Visitor counter code (4 posts)

  1. alvaradopau
    Posted 2 years ago #

    Hello there, I'm sorry if this has already been asked but I cannot find a thread.. I'm wondering if it's possible to display a visitor counter from WordPress.com stats inside my self-hosted blog?

    I do not have widgets enabled, so I need the code to include the number on the footer. Is this possible?



  2. Brandon Kraft
    Happiness Engineer
    Plugin Contributor

    Posted 2 years ago #

    This isn't a feature of Jetpack and beyond the level of support we can provide.

    What you (or a developer) can do is create a simple app at http://developer.wordpress.com and leverage the Stats endpoint on our API ( https://developer.wordpress.com/docs/api/1/get/sites/%24site/stats/ )

    You wouldn't want to directly call the API on each page load, so an app that would pull down the numbers and store it as a transient (maybe check once every 30m?), then output that value on the front end.

    This is a cool idea. I'll see if I can put a tutorial together (that said, it could be this week or six months from now). I'll make a note to post an update here once/if I get to it.


  3. alvaradopau
    Posted 2 years ago #

    Thank you very much for the response, it would be even cooler if one could choose to display average weekly/monthly stats, perhaps calling the API once a day or so. Unfortunately I'm not a developer but I'll see if there is something I can do.


  4. Brandon Kraft
    Happiness Engineer
    Plugin Contributor

    Posted 2 years ago #

    That is a cool thought too. It's on my wish list :)

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