Google Analytics(分析)未记录自定义维度 [英] Google Analytics not recording custom dimension

查看:68
本文介绍了Google Analytics(分析)未记录自定义维度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2018年,我为我的GA属性创建了四个自定义维度.它们已经正确收集,可以通过相关的通用航空报告获取.

In 2018, I created four custom dimensions for my GA property. They have been correctly collected and are available through the relevant GA reports.

上周,我添加了一个额外的自定义维度,但未记录该自定义维度.我不明白为什么.

Last week, I added an extra custom dimension, but this custom dimension is not being recorded. I fail to see why.

首先,我在相关属性的自定义定义"->自定义维度"下添加了自定义维度.

First, I added the custom dimension under "Custom Definitions" -> "Custom Dimensions", for the property in question.

然后,在通过GA记录浏览量的每个页面的页眉中,将自定义维度的名称映射到更易读的内容.

Then, I map the name of the custom dimension to something more readable, in the header of each page that's recording pageviews through GA.

gtag('config', 'UA-XXXXXXXX-X', {
    'custom_map': {
        ...
        'dimension5': 'primaryCategory'
    }
});

最后,我将值分配给自定义维度.

Finally, I assign values to the custom dimensions.

gtag('event', 'add_dimensions', {
    ...
    'primaryCategory' : '<?php print $primaryCategory; ?>'
});

但是,在这个新的自定义维度中没有可用的报告.

But, in no report is this new custom dimension available.

我在做什么错了?

推荐答案

由于您要通过事件代码传递自定义维度值,因此该值不会显示在网页浏览"报告中.为了在页面路径中报告它,您可以使用 config 命令传递它.您需要先使用set命令定义 custom_map :

Since you're passing your custom dimension value with an event tag it won't appear in Pageview report. In order to have it reported within page path, you may pass it withing the config command. You'll need to define your custom_map before with a set command:

gtag('set', {
  'custom_map': {
      ...
      'dimension5': 'primaryCategory'
    }
  });

gtag('config', 'UA-XXXXXXXX-X', { 'primaryCategory' : '<?php print $primaryCategory; ?>' });

在这种情况下, dimension5 将在 pageview 事件中传递并正确报告.

In that case, dimension5 will be passed within pageview event and properly reported.

这是一个有效的样本,您会看到在Tag Assistant中传递了自定义尺寸值.

Here's a working sample and you could see custom dimension value passed within Tag Assistant.

还可以考虑查看自定义维度的范围.将其作为 user 维度时,您将只能报告用户会话中的最后一个值.

Also consider reviewing the scope of your custom dimension. While having it as user dimension you'll only be able to report the last value within the user session.

这篇关于Google Analytics(分析)未记录自定义维度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆