In my site,
the GA is track by adding the track code at the header, a standard implemented of GA track:
ga('create', 'UA-483951-1', 'auto');
ga('send', 'pageview');
And I am using codeigniter PHP framework to handle the language changes ,
$lang = $this->session->userdata('site_lang');
$this->config->set_item('language', $lang);
$this->lang->load("site", $lang);
which the language code is stored at the session inside of inside the URL.
The problem is , in the GA panel, how to check how many people visit the page in different language?
Thanks a lot for helping.
You could store the language in a custom dimension, i.e. a field for categorical data that you can define yourself.
In your GA account go to the property settings, custom definitions, custom dimension. Add a new dimension. Give it a name, which will be used in the reporting interface (in the code custom dimensions will be referred to by their order of creation via a numeric index).
Select a "scope". Choose either hit scope (i.e. the value will be stored for every pageview/interaction separately) or session scope (only the last selected value will be stored and applied to the whole of the session).
Then you need to modify your tracking code to set the custom dimension in the code:
ga('create', 'UA-483951-1', 'auto');
ga('set', 'dimension1', <?php echo $lang; ?> );
ga('send', 'pageview');
The "dimension" keyword indicates that your are setting a custom dimension, the index 1 refers to the first dimension you have created. The "set" call will set the field value for every interaction that follows the set call.
The custom dimension is now ready; it will not show up in the standard reports, you need to select is a secondary dimension, use it in a custom report or build segments based on the recorded value.