du16178 2016-07-13 07:53
浏览 74
已采纳

如果该语言不在URL中,如何检查google analytic中每种语言的访问数据

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.

  • 写回答

1条回答 默认 最新

  • duanniling0018 2016-07-13 08:25
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向