WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. alvaradopau
    Member
    Posted 1 month 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?

    Thanks

    https://wordpress.org/plugins/jetpack/

  2. Brandon Kraft
    Happiness Engineer
    Plugin Author

    Posted 1 month 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.

    Cheers!

  3. alvaradopau
    Member
    Posted 1 month 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.

    cheers!

  4. Brandon Kraft
    Happiness Engineer
    Plugin Author

    Posted 1 month ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic