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!

  • Can you clarify what you mean by search the domain URL?
    – dan
    May 5, 2014 at 6:29
  • I believe that he was considering setting up reporting in analytics URL path matching. May 5, 2014 at 11:01

2 Answers 2


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'



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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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