I was planning to use PHP to create a tracking system for recording the impressions and clicks of my ads (not served by Google Ads). But during my research on how to design the database, I saw someone suggested that Google Analytics can do that. I think that might also work for me.

But before I decide to use Google Analytics for tracking, I would like to ensure it suits my need. So can GA group data by visitors' countries? For example, I sometimes would like to see the percentages of countries that contribute to the clicks of an ad.

  • Are you talking about ads that you are serving yourself on a website which you have control of? Not your ads appearing elsewhere or ads from other places appearing on your website? Commented Dec 2, 2019 at 13:23
  • @GeoffAtkins Yes. I'm talking about ads that I'm serving myself on a website which I have control of.
    – Ian Y.
    Commented Dec 2, 2019 at 15:34

1 Answer 1


Yes, Google Analytics can do what you want, but not alone. If the ads you're looking to track immediately leave your website, then you're going to have to use another way of tracking the user interaction.

Either manually send event data to Analytics or using Google Tag Manager to log an event every time an ad is clicked (picking up on a unique class or other attribute assigned to the adverts) is probably the easiest way. You can even give individual ads separate event labels, to make it possible to track each ad individually.

If you had a tracking page between the ad click and the ad destination (i.e. the ad lead to another script on your page which logs the click and then redirects the user off-site automatically), you can do this server side (as opposed to client side with events logging the click). More information about this can be found on this Stack Overflow question.

Once the event data is in Google Analytics, you can configure that as a goal and cross reference it against the user geographical location (by country, region, city, etc) as well as a whole host of other factors (device type, browser, traffic source, time of day). You might not be able to set up individual goals for each ad if you have more than 20 (you're limited to 20 goals in Analytics).

However, using secondary dimensions in the Behaviour > Events view you could break that data down by county vs individual ads (if you used separate labels for different ads). This won't be as comprehensive as tracking at goal level, but it will still give you the country level data that you require.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.