Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analytics adapters: attach arbitrary labels to analytics events #12597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgirardi
Copy link
Collaborator

Type of change

  • Feature

Description of change

This allows attaching arbitrary labels to all analytics events, to facilitate distinguishing between experiment groups. For example, setting

pbjs.setConfig({
   analyticsLabels: {
      "some_experiment": "some_group"
   }
})

will cause all event payloads seen by analytics adapters to contain

 {
   // ...
   analyticsLabels: {
     "some_experiment": "some_group"
   }
 }

Additionally, adapters that extend the base AnalyticsAdapter's track method will see the same label data come in as a new labels parameter, e.g. track({eventType, args, labels}). (Unfortunately the nicer name labels is already taken in event payloads, where it sometimes refers to sizeMapping labels).

Other information

Closes #10705

@patmmccann
Copy link
Collaborator

Cc @3link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User id Module sample rate
3 participants