Showing visited countries
Just like showing your hit count, or uptime, you can also show which countries have visited your sites using your embed code.
Once embedded, tinylytics will return a country list using emoji flags, in alphabetical order.
All it requires, is that you amend your embed script a little, and add an extra parameter at the end of .js
.
To show countries, first add the following parameter to your embed code: ?countries
.
So your embed script url should look like this now:
https://tinylytics.app/embed/YOUR_EMBED_CODE.js?countries
If you have other features enabled, like kudos, or others, you can do it like this:
https://tinylytics.app/embed/YOUR_EMBED_CODE.js?kudos&hits&countries
Next up, we need to add an element on your site, wherever you want so it's up to you.
Add the following anywhere on your site:
<span class="tinylytics_countries"></span>
We'll replace any content inside the snippet. Feel free to style as you need.
Once the embed code is loaded, it'll look for a class of tinylytics_countries
and if it finds it, it will add the countries that visited your site.
Here is an example:
🌍