Google’s Analytics platform is a great tool for measuring site impact and coming up with new ways of improving your site. If your site is already using Analytics, you’ll be able to track both the original and the translated site with the same tracking code (in fact, this is already happening), but by default, Analytics will group the hits from both domains, original and translated, into the same view, and you’ll be unable to separate the impacts of both from one another. Fortunately, it is possible to set up Analytics to do just that for you!
If you already have a tracking code on your site, you’re already pumping data into Analytics. That same tracking code is replicated onto the translated site by Easyling when proxying the site. However, in its default setup, Google’s Analytics platform will collect all the visitor data under the same view, and only capture the page name the visitor is landing on, not the domain name under which the visitor is viewing the page, which means that a visit to the original site and the translated site will show up as two visits, but to the same page, meaning you can’t accurately judge the effect the translated site has on your impact.
If you want to have a complete picture of your site’s visitors, including which domain they’re using to reach your site, you’ll have to set up a custom view in Analytics, and specify a filter to override the page attribute (properly called the Request URI in Analytics) to include the domain (hostname) as well. Once you do that, however, you won’t be able to go back to the old way (should you want to), so before setting up the filter, it’s good practice to clone the view and work on the clone.
1. Setting up the Analytics account
If you already have an Analytics account to measure the impact of your original site, you can skip this step.
Otherwise, the first step is to set up a tracking ID on Google Analytics. We recommend using the new Universal Analytics, which will grant you more comprehensive access to your data. If you’ve already done this, and you’re tracking visits, feel free to skip this step.
Once you get your tracking code, copy and paste the displayed snippet into the header of your page (the area just before the </head> tag in the page source code). You’ll need to do this for every page you’re looking to track. If you’re using templates to create your pages, you’re best off by editing the template directly to include the code, while smaller sites may get away by hand-modifying the pages.
Please Note: If you already have a tracking script, you need to remove any reference to a function called “_setDomainName”. Leaving this in the script will cause Analytics to report any hits on the proxied site as if it went to the original site.
2. Creating the custom view
Once the tracking code is in place, you’re mostly set: your site is registering hits, from both domains. All that is needed is a little configuration to see the domains, not just the URI.
Create a new view by going to the Admin tab, and selecting the property containing your site. While you can do all this without creating a new view, it’s certainly advisable, since you’ll be replacing one of the default fields.
Once the new view is created, add a Filter to it: select “Custom filter”, and specify “Advanced”. In the constructor you’re presented with, select “Hostname” for the A field, and “Request URI” for B, as well as the output constructor. Enter “(.*)” into the capture fields for both fields, and “$A1$B1” into the output field. This will take the hostname (the domain), then the request URI (the page), chain them together, and replace the original page with the new field, which shows the full URL used to reach that page.
Using the view you just created, you’ll see the full URLs in your reports. This will allow you to determine just how much of the traffic is being generated by the translated site, and if you have multiple languages served by Easyling, to determine which language generates how much traffic. A similar, but not identical, effect can be achieved by specifying the page as the primary dimension of your report, then hostname as the secondary dimension.
There you have it! Any reports generated using this view will allow the separation of traffic by domain (and consequently, by language), all with the use of a single tracking ID.Dedicated demo for You Tweet