Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a blog that targets different regions. The Europe region blog has different sections in different local languages such as English, French and German. I wonder how to track and analyze the different sections.

My initial thought is to search the domain URL, but I found it is not a good idea. For example, the URL for the Europe blog is like www.domain.com/europe. If you click the French section, the URL is like www.domain.com/europe/language/french. If you click an article in the French section, it is like www.domain.com/article_name. Notice the article link is not www.domain.com/language/french/article_name!

share|improve this question
Can you clarify what you mean by search the domain URL? – dan May 5 '14 at 6:29
I believe that he was considering setting up reporting in analytics URL path matching. – Stephen Ostermiller May 5 '14 at 11:01

Short of rethinking you URL structure (I'm with Stephen Ostermiller), you can use Virtual Pageviews and some conditional switching for this. On your template that displays single posts, you'll need to do some checking. Pseudo code...

$region = get_the_region();
$lang = get_the_language();

Then, instead of the default call to GA:

ga('send', 'pageview');

you'll print out those variables in a virtual pageview.

ga('send', 'pageview', {
  'page': '<?php echo $region . "/" . $lang; ?>/article-name'


share|improve this answer

You may want to rethink your URL structure. There are good SEO reasons to put all your French content into a single directory that is separate from the other languages. See How should I structure my URLs for both SEO and localization?

If you can't do that, Analytics does allow you to specify a custom variable. The variable could specify the region and language for the page. Your blog would need to set the custom variable in the Analytics JavaScript snippet for each page view.

Once the custom variable is in place, you can get segmented reporting using advanced segments within Google Analytics.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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