简体   繁体   English

从Google Analytics(分析)追踪Drupal角色

[英]Tracking Drupal Roles from Google Analytics

I have a Drupal website with a few different roles. 我有一个Drupal网站,具有几个不同的角色。 I can't figure out how to view the breakdown of those roles within Google Analytics. 我不知道如何在Google Analytics(分析)中查看这些角色的细目分类。

Here is a screenshot of my GA Module in Drupal; 这是我在Drupal中的GA模块的屏幕截图;

在此处输入图片说明

I want to get page views statistics broken down by a role or if they're just not logged in (that's an "anonymous user", right?!). 我想获取按角色分类的页面浏览量统计信息,或者是否只是未登录(这是“匿名用户”,对吧?!)。

But I can't see where this breakdown is available to view in the Google Analytics webpage anywhere. 但是我看不到可以在任何地方的Google Analytics(分析)网页中查看此细分的地方。

I am confident that I've got it hooked up correctly as I can see my tracking through different pages on my Drupal site. 我相信我已经正确连接了它,因为我可以在Drupal网站的不同页面上看到跟踪。 I just don't know how to break down by Role. 我只是不知道如何按角色细分。

***** EDIT / UPDATE ***** *****编辑/更新*****

I've done some further reading and it seems you need to do the following; 我已经做了一些进一步的阅读,看来您需要执行以下操作;

First go in to Google Analytics and navigate to Admin -> Custom Definitions -> Custom Dimensions. 首先进入Google Analytics(分析),然后导航至管理->自定义定义->自定义维度。 And then click NEW CUSTOM DIMENSION. 然后单击“新自定义尺寸”。 Call it something like "User Roles". 称其为“用户角色”。

Then over in Drupal, navigate to Custom Dimensions within the Google Analytics Module and do something like; 然后在Drupal中,导航至Google Analytics(分析)模块中的“自定义维度”,然后执行类似操作;

在此处输入图片说明

That text is small but it says [current-user:roles] - you can see a list of avaible inputs by clicking "Browse available tokens" further down the page. 该文本很小,但显示为[current-user:roles] -您可以通过单击页面下方的“浏览可用令牌”来查看可用输入的列表。 There are dozens of options! 有数十种选择!

Now I am playing the waiting game and hoping for this to take effect. 现在,我正在玩等待游戏,并希望它能生效。

EDIT TWO; 编辑两个;

Here is proof that the dimension is being set when inspecting the colsole log via Google Analytics Debugger (A Chrome Extenstion which seems really useful). 这证明在通过Google Analytics(分析)调试器(似乎非常有用的Chrome扩展程序)检查控制台日志时已设置尺寸。

在此处输入图片说明

That's me, but logged out. 是我,但已注销。 And I get "Super Administrator" when logged in. 当我登录时得到“超级管理员”。

I seem to have solved this. 我似乎已经解决了这个问题。 So as well as the screen shots and information above this is basically the steps to get Google Analytics working with User Roles on Drupal. 因此,除了上面的屏幕截图和信息之外,这基本上是使Google Analytics(分析)在Drupal上使用用户角色的步骤。

  1. Once you've installed the Google Analytics Module on Drupal, make sure you go to "Roles" and select all user types 在Drupal上安装Google Analytics(分析)模块后,请确保您转到“角色”并选择所有用户类型
  2. Go to Google Analytics and navigate to Admin -> Custom Definitions -> Custom Dimensions. 转到Google Analytics(分析),然后导航至管理->自定义定义->自定义维度。 Click "NEW CUSTOM DIMENSION" and add a custom dimension called "User Roles". 单击“新自定义维度”,然后添加一个名为“用户角色”的自定义维度。
  3. Back in Drupal, navigate to Custom Dimensions within the Google Analytics Module and add "[current-user:roles]" to the Value field for the "1" index number key (see OP for more info) 返回Drupal,导航至Google Analytics(分析)模块中的“自定义维度”,然后将“ [current-user:roles]”添加到“ 1”索引数字键的“值”字段中(有关更多信息,请参阅OP)

  4. In Google Analytics, navigate to Behaviour -> Site Content -> All Pages and where is says "Secondary Dimension" (with a dropdown), select the dropdown, select Custom Dimensions from the dropdown, and select User Roles (if it's not there, this hasn't worked for you for some reason). 在Google Analytics(分析)中,导航至“行为”->“网站内容”->“所有页面”,并在“次级维度”(带有下拉菜单)的位置显示,选择下拉菜单,从下拉菜单中选择“自定义维度”,然后选择“用户角色”(如果不存在,由于某种原因,它对您不起作用)。 But that should load the screen something like; 但这应该会在屏幕上加载类似内容; 在此处输入图片说明

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM