Analytics
5.2K members online now
5.2K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

tracking language stats for one website with multiple languages

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

My company has a multilingual website with three language options.  When someone first goes to the site there is a pop-up window where they select their country and language.  This sets a cookie which stores the country/language for that person in subsequent visits.  Google Analytics tracks the preferred language of the user based on their computer/browser language setting. I want to track the actual language pages the user goes to when on the website.  How would I do that?  The URL of the pages on the site is the same no matter what language is displayed (i.e. mydomain.com instead of mydomain.com/de or de.mydomain.com).

 

Not sure if Google Tag Manager offers a better solution but thought I would start here.

 

Thanks,

Michael

Re: tracking language stats for one website with multiple languages

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆
You can create a custom dimension - e.g. "User Language" - in Admin > Custom Definitions > Custom Dimensions with scope sets to Session or User.

Then send dimension data with event when user select the language.
Here is an example code:

ga('set', 'dimension1', "English");
ga("send","event","Language","Select","English");

Thanks to that all hits in current and future sessions of specific user will have "dimension1" set on "English".

In reports you can use "Secondary Dimension" to display information about "User Language".
You can also create separate views with filter to display sessions for specific languages or you can create segments for specific language.

If you create new custom dimension you have to wait 24-48 hours until dimension will work and you have to also wait until all data will be processed.

You can read more about custom dimensions here:
https://support.google.com/analytics/answer/2709828?hl=en

Re: tracking language stats for one website with multiple languages

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks Tomasz. I'll look into this.

Quick question. Can this same solution be accomplished via Google Tag Manager without having to modify the GA tracking code? I don't have access to the GA tracking code without getting the IT department involved.

Re: tracking language stats for one website with multiple languages

Participant ✭ ✭ ☆
# 4
Participant ✭ ✭ ☆
In general, yes.
Sending events in GTM is quite easy but configuring appropriate triggers sometimes require some knowledge about web development .