HOWTO: Only track visitors from certain countries

We get requests every once in a while to only log data from certain countries. We don't currently offer a way to filter out traffic other than by IP address. But there is a way to do this by adding a few extra lines of javascript to your site.

The service we use for geolocation is called Maxmind. They have a free javascript file you can put on your site that includes a few functions to determine that visitors location. You can use these functions to either call our tracking code only for certain countries, or only NOT for certain countries.

Say you only want to track US visitors. In the example below is our standard tracking code, with the additional code highlighted in red to only track US visitors. We're using [] in place of HTML tags:

[script src=""][/script]
[script src=""][/script]
if( geoip_country_code() == "US" ) clicky.init( YOUR_SITE_ID );

This can be used with any country of course, you just need to replace US with the appropriate 2-letter country code (in capital letters). You can view a list of standard 2-letter codes here.

If you want to do more than one country, say only US and Germany, you can do like this:

if( geoip_country_code() == "US" || geoip_country_code() == "DE" ) clicky.init( YOUR_SITE_ID );

You can also track all countries except the ones you specify. Say you wanted all traffic except US and Germany:

if( geoip_country_code() != "US" && geoip_country_code() != "DE" ) clicky.init( YOUR_SITE_ID );

That's all there is to it!
2 comments |   Jan 27 2010 3:05pm

New feature: Favorites

Are there certain pages on your site that care about the most? What about specific countries or cities or search terms or web browsers? Wouldn't it be nice if you could flag the ones you care about the most so you can always have instant access to their stats? Now you can!

When viewing almost any "popular data" report, you will see a star next to every item. Just click on any any star to flag that item as a favorite. Next time you view that report (e.g. refresh the page) all of your favorites will appear at the very top. This makes it very simple to track the specific items that matter the most to you.

For example, there are a number of pages on that we want to know their daily traffic for. Filtering content can take a while if you have tens of thousand of pages so the only real solution for this before was setting up a goal to track a page. But these aren't really "goals" - we just wanted quick access to the stats for those pages. This was messy and cluttered up our goal report.

This new feature makes tracking your most important stats a nice reality, and is available to all users. Here's an example screenshot with some of the pages that are most important to us, now at the very top of our content report.

8 comments |   Jan 26 2010 11:34pm

Google Analytics campaigns; Big updates for goals

It has been known by some of you that we were planning to add dynamic campaign support using the same tags that Google Analytics (GA) and Urchin use. We are happy to announce this has finally been released.

What does that mean? Previously on Clicky you had to pre-define your campaigns by giving us matching strings for your campaign landing pages. You could also specify referring domains, so any visitor who arrived via that domain was flagged as a campaign visitor. This worked pretty well but left something to be desired.

GA's campaign system is dynamic which makes it quite a bit more flexible. Instead of having to pre-define anything, you just add a couple variables to your landing page URLs and GA parses them automatically and it's basically magic. While I think our system has some advantages (e.g. you don't have to change the links for your ads to include new variables), we do have a ton of users that use both GA and Clicky together, so we thought that adding automatic support for GA campaigns into our system would make a lot of GA users happy when they started using our product.

If you have any GA campaigns running for your site, you should see that they now appear in our campaigns report automatically. They are grouped by the utm_campaign variable (the campaign name) and then broken down by unique parameter groupings, ordered from most to least visitors. Here's an example from one of our sites:

We had to blur out any identifying data but it should give a good idea of how the new campaign system works. And don't worry, the old campaigns are still there, and you can still create pre-defined campaigns. In other words, both systems can be active at the same time, and the data is reported together in the same report. We think is a powerful combination.

If you need help setting up GA campaigns, go to your campaign setup page on Clicky. There is some more information in there about them, along with links to relevant Google support documents for help setting them up.

Updates to Goals

In the screenshot above, you may have noticed a new column you don't normally see: Conversions. This is a great update to our goal system, and it doesn't just apply to campaigns.

Anytime you have a visitor who completes a goal, we grab all that visitor's metadata (country, web browser, etc) and increment the conversion count for each of those items. So as you browse the various reports on Clicky, you will see conversion metrics in almost all of them now. Here's another example:

You can now easily see which types of visitors are converting the best, both in terms of total number, and percent. You can also click the conversion number for any item, which will filter your visitors down to those who match that item AND have completed a goal. From here, you can get even more data about these visitors.

Conversion history

What if you want to see conversion history, though? Don't worry, we got that covered. When you click the red/green percentage to see a graph of the items history, it works just like it used to, except there will be an additional line showing you the # of conversions for each day as well. This screenshot doesn't show it terribly well since this has only been running for a few days, but it gives you an idea. The conversion line is green. You know, like money!

API conversion data

Conversion metrics are output with the API as well for any "popular data" request that supports it (which is almost all of them). There are two new keys: conversions, and conversion_percent. This hasn't been added to the docs yet but will be by end of day.

Goal funnels

Previously you could only set one campaign as a funnel for any goal. Now you can select multiple campaigns for a single goal, or NO campaigns which will make the funnel apply to ANY campaign.

Alerts for goals and campaigns

Like goal funnels, previously you could only set an alert for a single campaign or goal. And like the new and improved! goal funnels, you can now select multiple campaigns or goals for a single, OR, select none of them to get an alert when ANY campaign or goal occurs.

9 comments |   Jan 25 2010 3:11pm

Twitter followers removed

For about a year we have had a feature that showed you how many followers you had in Twitter, and it was integrated nicely into the stats. This data is provided by a third party, As that service has grown a lot, the data has become somewhat unreliable because they can only hit twitter's API so many times in a day. With probably more than a million people checking their follower history on that site, they just can't update every person's follower count every day, so some of the data becomes stuck or out of date.

We have plenty of experience with Twitter's API ourselves, and the limits on their API can be very frustrating. This has also lead our own Twitter Analytics feature to become less reliable than it used to be, with most searches only being updated once or twice per day rather than every 30 minutes as it used to be. Don't worry, we are about to fix this by distributing the load for our API hits across 4 servers so we can do 4 times as many per day.

Anyways, I'm not putting the service down in anyway (I know the owner - Hi Boris!) but the problem is that this feature leads to a TON of support emails to us, and that takes a lot of our time. With this being completely out of our control, it no longer makes sense for us to have this feature. So as of today, it is no more.

I'm sorry, I know a lot of people liked it, but I hope you understand why we are doing this. We may code this feature ourselves in the future if enough people want it back.
14 comments |   Jan 06 2010 12:34pm

Make it load faster, ma!

Some of you with a large number of sites justifiably complain that the user homepage can take a while to load. This is because we have to lookup traffic data for every single site in your account before we display the page. Unfortunately we do not have a way to make this data lookup faster, but we can make the page load faster by just not looking it up at all, right?

So we've just added a new option on the userhome customization page to "make it load faster". Checking this box will disable all data lookups and instead just show you your list of sites. It should load very fast, no matter how many sites you have in your account.

We've also changed the homepage so when you first come to Clicky, if you are already logged in, you will be automatically redirected to your user homepage. However, clicking any link on our site (such as the logo) will actually take you to our homepage. It's only when you first come to the site via bookmark or by typing in "" that you will be automatically redirected to your user page instead.

What's next

Other than answering emails, we basically took this entire month off for some much needed relaxation. But January will bring some exciting features. We're planning to add the following new things next month:

  • IP tags/filters - These will become global so they'll apply to every site in your account automatically. We'll also be adding wildcard support (123.123.123.*) and the ability to import them from a comma-seperated list.
  • Favorites - flag the items you are most interested in so they'll always show up at the top of your reports (pages, searches, countries, etc)
  • Urchin / Google Analytics campaign compatibility - we're going to keep our existing "manual" campaign system, but we're also going to add compatiblity with Google's campaign tags (utm_campaign, etc). This will have two benefits. First, there will no longer be any need to setup a campaign manually in our system. They will be completely dynamic, so there will be no limits of them. Second, many people that use Clicky also use GA, so their existing campaigns will just automatically start working with Clicky without having to do anything (except pay for a Pro account!)
  • Android widget - one of our users made a basic Android widget. We were planning to commission this starting next month, but now that he's laid a basic foundation we're just going to pay him to make it do exactly what we've been dreaming about.
8 comments |   Dec 30 2009 5:19pm

Next Page »

Copyright © 2018, Roxr Software Ltd     Blog home   |   Clicky home   |   RSS