Forums

Traffic Monitors

Exactly what do the Traffic Monitors display, I have a google analytics in my web app and the Traffic Monitor data does not correlate at all with what I get from google.

We show hits, which are a pretty crude way of counting traffic on your site. One user looking at one page generates multiple hits. Google has more data it can use to give you a better picture of number of visitors, unique visits, sessions, etc...

how can I see the web traffic statistics of my site?

If you go to the "Web" tab, they should be at the top of the page for your site. Free accounts get some basic numbers (hits for the last hour, day and month) and paying accounts get graphs showing how the numbers are changing over time.

ok got, thanks giles!!!

Sorry for adding to an old thread, but I just now looked closer to the traffic monitor, particularly the minute-by-minute breakdown and browsed to my app on another tab. I saw that this one call has been counted as 23 hits. Does that mean I have to divide my beautiful monthly traffic by 23 to get a rough estimation of users? Or would every navigation on my page also be counted as 23 new hits? And I almost got excited about my monthly traffic ;)

There's no accurate way to count users in a web app. We count hits as anything that requires an http response, so each request for an image or css or javascript is a hit. The multiplier between page views and hits will depend on your web app and probably on which page. That's why things like google analytics need javascript to make even a wild, inaccurate guess at unique users.

Thank you for the clarification!

the day I set up Google Maps, and embeded a map on the site, is showing as 50K hits! Can that be right?

and setting up Google analytics on here, is that straightforward?

Doing that will require you to paste a small script into all of your pages. If all of your pages have their own individual template, you should set up a base template and have all of the other templates extend that template. More info here

I have Google Analytics set up on my own site.

Here is an example of how you can set up your base template:

<!DOCTYPE html>
<html>
    <head>
        <title>{% block title %}{% endblock %}</title>
    </head>
    <body>
        {% block content %}{% endblock %}
    </body>
</html>

Here is how a template for one of your pages would be set up, assuming that the base template is named "base.html":

{% extends 'base.html' %}

{% block title %} This text will appear in the <title> tag {% endblock %}

{% block content %}
    <h1>Example heading</h1>
    <p>This content will appear in the page's body tag</p>
{% endblock %}

Putting these stuff in all of your templates might be a lot of work especially if you have lots of pages, but it will be convenient in the long run because you'll be able to add stuff (such as the google analytics script you would have to add) to all pages simply by editing base.html.

I would recommend making your base.html, make the necessary changes to just one of your templates, then test it to make sure you did it right. Then you can make the changes to the other templates.

After you've done this, you can go to analytics.google.com and set up your thing. They will ask you to put some tracking code into your <head> tag. Put that code in base.html.

ok, thanks

and on the google site it asks for either:

https://madmartin.com 
or
http//madmartin.com

on laptop it comes up as: madmartin.pythonanywhere.com

is that an issue?

Yes. On the google thing you are supposed to put madmartin.pythonanywhere.com.

Madmartin.com is just a random spanish site

there doesn't seem to be an option to put in just 'madmartin.pythonanywhere.com'

only lets you prefix it with either http::// or https://

is there a workaround?

sure, looks like MadMartin is some kind of Spanish music band, will change the name soon here

https://madmartin.pythonanywhere.com

put that in there

cool, works now

can you check it out ,

either

https://madmartin.pythonanywhere.com
https://madmartin.pythonanywhere.com/input

should work , cheers

mad martin.com just looks like a domain seller of some sort

seems to be working now

so the next thing is: how to convert madmartin.com to https://madmartin.com?

actually, no worries about this question, I've seen the 'slider' on the dashboard and set it to 'force https', so I guess that will do the trick

It's a little more complicated than that :-)

By default, we serve all websites on both the HTTP and the HTTPS URL. So, for madmartin.pythonanywhere.com, you can always access it as either http://madmartin.pythonanywhere.com and https://madmartin.pythonanywhere.com -- both will work just fine.

If you were to use a custom domain like www.madmartin.com, then it would also be available at http://www.madmartin.com and https://www.madmartin.com. However, while the first would work just fine, in order to get the second one to work, you'd need an HTTPS certificate. When you're using a custom domain, there is an option there to get an auto-renewing Let's Encrypt certificate, which is a free and simple option for doing that. More information about that on this help page.

(The HTTPS certificate step isn't necessary for websites like yourusername.pythonanywhere.com because we have a "wildcard" certificate that covers all subdomains of pythonanywhere.com.)

Once you have HTTPS set up, either because you're using a subdomain of our domain, or after you've done the Let's Encrypt thing, "force HTTPS" is just a bit of icing on the cake -- all it does is set things up so that if someone goes to the HTTP version of your site, they're automatically redirected to the HTTPS version.

ok, thanks for the info

A more "raw" way on analyzing traffic on the website is to directly analyze the access logs. You can then write code that counts exactly what you want. (Count the number of distinct IP addresses to count the number of visitors for example,...) The only limit is your imagination.

@omamansou That's also possible. Thanks for the suggestion!