Skip to content

Add support for custom dimensions and metrics #278

@leandroz

Description

@leandroz

This is a...

  • 🪲 Bug Report
  • 🚀 Feature Request
  • 📜 Documentation Request

Which target(s) are you using?

  • Google Analytics
  • Google Analytics (gtag)
  • React Native Google Analytics
  • Google Tag Manager
  • React Native Google Tag Manager
  • Amplitude
  • Segment
  • Other/Third Party: ...(please specify here)

🚀 📜 What's missing from Redux Beacon that you'd like to add?

Custom dimensions and metrics are a powerful way to send custom data to Google Analytics. Web developers can use custom dimensions and metrics to segment and measure differences between logged in and logged out users, authors of pages, levels in games, or any other business data you have on a page.
https://developers.google.com/analytics/devguides/collection/analyticsjs/custom-dims-mets

So basic idea is to add support for this, the problem I see is that we don't know in advance the field key, as it would be anything between dimension1 and dimension20, and the same for metrics. (The number of custom dimensions and metrics varies between plans I believe)

One option would be to pass a dimensions object with numbers as keys, and then build the parameters from there. I will be happy to send a PR once agreed on the design.

Examples:

ga('send', 'pageview', {
  'dimension15':  'My Custom Dimension'
});

ga('send', 'event', 'category', 'action', {
  'metric18': 8000
});

Can you help out?

  • 🌟 I am a legend and can get started on a pull request right away given the go-ahead.
  • ⭐ I am a superstar and would like to help out given some guidance.
  • 😞 I won't be able to help out on this one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions