eventsgoogle-analyticsdrupal-8google-analytics-4custom-dimensions

Google Analytics not sending any events or custom dimensions data to dashboard


Scenario: I am using this module: https://www.drupal.org/project/google_analytics version 3.1 It is using Google Analytics 4. Drupal version 8.9.x

We followed the documentation https://developers.google.com/analytics/devguides/collection/gtagjs/custom-dims-mets to create some custom dimensions and added in the Google Analytics configuration accordingly.

When view the page source, I see code is added there:

  gtag("config", "G-MESUREMENT-KEY", {
    "custom_map": {
      "dimension1":"user_company",
      "dimension2":"user_role",
      "dimension3":"user_badge_access"
    }
  }
  );
  gtag("event", "custom", {
    "user_company":"TEST Company",
    "user_role":"authenticated, member_administrator, administrator",
    "user_badge_access":"Office"
   }
  );

Using some Chrome GA debugger "GTM/GA", I see parameter is passing there. In the request "Pay Load" of Chrome debugger it shows its sending the values:

en=page_view&ep.anonymize_ip=true en=page_view en=custom&ep.user_company=Surface%20Oncology&ep.user_role=authenticated%2C%20member_administrator%2C%20administrator&ep.user_badge_access=Office

BUT I don't see the data when I open DebugView in the GA dashboard! And Interesting part is, some chrome debugger like "Google Analytics Debugger 2.8" when enabled, which seems open a debugger and connect to GA dashboard, DebugView is showing the events and parameters data. So there must be something which restricting or refusing to connect with GA Dashboard to push the data.

enter image description here

Reads lot of documentation, did lot of test but failed to find a reason for that. The site is fully login protected but event /user/login page which is accessible to all, not sending the data at all.

If some one can shed some light on the issue, it will really really help for me. Thanks in advance.


Solution

  • Actually this is my mistake of my understanding. All data is pushing to GA dashboard no confusion. The reason why I don't see data when creating a comparison report based on custom dimension parameters is due to "scope" difference.

    So if you want to create a report based on event scoped parameters, please go to Engagement->Events, and if you want to create a report based on user scoped parameters, please go to Audience tab, but user scoped report will not show data if captured users record is less than 10.

    A documentation for reference: https://support.google.com/analytics/answer/2709828?hl=en