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.

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

报告相同问题?

悬赏问题

  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教